Skip to content

Commit

Permalink
Merge pull request #181 from pytest-dev/fix-mypy
Browse files Browse the repository at this point in the history
Fix mypy
  • Loading branch information
youtux committed Dec 1, 2022
2 parents ae5c0c0 + d3ff8e8 commit 0499ac4
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 57 deletions.
107 changes: 57 additions & 50 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pytest = ">=5.0.0"
typing_extensions = "*"

[tool.poetry.group.dev.dependencies]
mypy = "^0.982"
mypy = "^0.991"
tox = "^3.27.0"
packaging = "^21.3"
importlib-metadata = { version = "^5.0.0", python = "<3.8" }
Expand Down
6 changes: 4 additions & 2 deletions pytest_factoryboy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_current_deps(self, request: FixtureRequest | SubRequest) -> set[str]:
while hasattr(request, "_parent_request"):
if request.fixturename and request.fixturename not in getattr(request, "_fixturedefs", {}):
deps.add(request.fixturename)
request = request._parent_request # type: ignore[union-attr]
request = request._parent_request
return deps

def execute(self, request: SubRequest, function: DeferredFunction, deferred: list[DeferredFunction]) -> None:
Expand Down Expand Up @@ -110,7 +110,9 @@ def factoryboy_request() -> Request:
return Request()


@pytest.hookimpl(tryfirst=True)
# type ignored because pluggy v1.0.0 has no type annotations:
# https://github.com/pytest-dev/pluggy/issues/191
@pytest.hookimpl(tryfirst=True) # type: ignore[misc]
def pytest_runtest_call(item: Item) -> None:
"""Before the test item is called."""
# TODO: We should instead do an `if isinstance(item, Function)`.
Expand Down
Empty file removed requirements-testing.txt
Empty file.
5 changes: 1 addition & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ deps =

coverage[toml]

-r{toxinidir}/requirements-testing.txt

[testenv:py312-pytestlatest]
# allow failures of tests run with unstable python 3.12
ignore_outcome = true

[testenv:mypy]
commands = mypy {posargs:.}
deps =
mypy~=0.982
mypy~=0.991

-r{toxinidir}/requirements-testing.txt

[pytest]
addopts = -vv -l
Expand Down

0 comments on commit 0499ac4

Please sign in to comment.