Skip to content

Commit

Permalink
Fix accessing item.obj (mypy was rightfully complaining)
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux committed Jan 21, 2024
1 parent e28774c commit 4dcc2c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pytest_bdd/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import TYPE_CHECKING, cast

from _pytest._io import TerminalWriter
from _pytest.python import Function
from mako.lookup import TemplateLookup

from .feature import get_features
Expand Down Expand Up @@ -183,6 +184,8 @@ def _show_missing_code_main(config: Config, session: Session) -> None:
features, scenarios, steps = parse_feature_files(config.option.features)

for item in session.items:
if not isinstance(item, Function):
continue

Check warning on line 188 in src/pytest_bdd/generation.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_bdd/generation.py#L188

Added line #L188 was not covered by tests
if (scenario := scenario_wrapper_template_registry.get(item.obj)) is not None:
if scenario in scenarios:
scenarios.remove(scenario)
Expand Down

0 comments on commit 4dcc2c7

Please sign in to comment.