Skip to content

Commit

Permalink
Appeases mypy further and adds B905 to Flake8 ignore due to backward …
Browse files Browse the repository at this point in the history
…compatibility not allowing zip to use strict
  • Loading branch information
56kyle committed Sep 1, 2023
1 parent f55b650 commit 2815ee6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503
ignore = E203,E501,RST201,RST203,RST301,W503,B905
max-line-length = 80
max-complexity = 10
docstring-convention = google
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


package = "pytest_static"
python_versions = ["3.10", "3.9", "3.8", "3.7"]
python_versions = ["3.10", "3.9", "3.8"]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
"pre-commit",
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_static/parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _get_parameter_combinations(
"""Returns a list of parameter combinations."""
if len(parameter_instance_sets) > 1:
return list(itertools.product(*parameter_instance_sets))
return list(zip(*parameter_instance_sets, strict=True))
return list(zip(*parameter_instance_sets))

def get_instances(self) -> Tuple[T, ...]:
"""Returns a tuple of all possible instances of the primary_type."""
Expand Down
4 changes: 3 additions & 1 deletion tests/unit_tests/test_parametric.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from types import NoneType
from typing import Any
from typing import Dict
from typing import FrozenSet
Expand All @@ -22,6 +21,9 @@
from pytest_static.type_sets import PREDEFINED_TYPE_SETS


NoneType: Type[None] = type(None)


T = TypeVar("T", bound=Any)


Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def parametrize_types_test(
argnames: List[str] = [f"arg{i}" for i in range(len(argtypes))]
argtypes_formatted: str = ", ".join([f"{argtype}" for argtype in argtypes])
signature: str = ", ".join(
[f"{argname}" for argname, argtype in zip(argnames, argtypes, strict=True)]
[f"{argname}" for argname, argtype in zip(argnames, argtypes)]
)

return pytester.makepyfile(
Expand Down

0 comments on commit 2815ee6

Please sign in to comment.