Skip to content

Commit 02daacb

Browse files
authored
Merge pull request #133 from Zac-HD/missing-obj-attr
2 parents 67289b6 + 0d3bb9a commit 02daacb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

newsfragments/132.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bad interaction with custom pytest items that do not include an ``.obj`` attribute.

pytest_trio/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ def pytest_fixture_setup(fixturedef, request):
508508

509509
def automark(items, run=trio.run):
510510
for item in items:
511+
if not hasattr(item, "obj"):
512+
# Rare and a little strange, but happens with some doctest-like plugins
513+
continue
511514
if hasattr(item.obj, "hypothesis"):
512515
test_func = item.obj.hypothesis.inner_test
513516
else:

0 commit comments

Comments
 (0)