Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1734,8 +1734,16 @@
if holderobj in self._holderobjseen:
return

module_types = (types.ModuleType,)
# support IPython's DummyMod if the module containing it has been imported
if (
DummyMod := getattr(
sys.modules.get("IPython.core.interactiveshell"), "DummyMod", None
)
) is not None:
module_types += (DummyMod,)

Check warning on line 1744 in src/_pytest/fixtures.py

View check run for this annotation

Codecov / codecov/patch

src/_pytest/fixtures.py#L1744

Added line #L1744 was not covered by tests
# Avoid accessing `@property` (and other descriptors) when iterating fixtures.
if not safe_isclass(holderobj) and not isinstance(holderobj, types.ModuleType):
if not safe_isclass(holderobj) and not isinstance(holderobj, module_types):
holderobj_tp: object = type(holderobj)
else:
holderobj_tp = holderobj
Expand Down
Loading