Skip to content

Commit

Permalink
Fix mypy failing
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux committed Nov 30, 2022
1 parent ae5c0c0 commit 2a8e705
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 2a8e705

Please sign in to comment.