Skip to content

Commit c919fd7

Browse files
Remove unconditional test item attribute access (#268)
1 parent 39c6d0c commit c919fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_asyncio/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def pytest_runtest_setup(item: pytest.Item) -> None:
452452
if "event_loop" in fixturenames:
453453
fixturenames.remove("event_loop")
454454
fixturenames.insert(0, "event_loop")
455-
obj = item.obj # type: ignore[attr-defined]
455+
obj = getattr(item, 'obj', None)
456456
if (
457457
item.get_closest_marker("asyncio") is not None
458458
and not getattr(obj, "hypothesis", False)

0 commit comments

Comments
 (0)