Skip to content
Open
Changes from 1 commit
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
Next Next commit
Fixed an issue with running the same test multiple times sequentially
When pytest_runtest_protocol is called with item==nextitem multiple times, with a test that accepts some fixtures -> the second call forward raises an error.

This is caused in WorkerInteractor when the same test appears twice in a row in the queue.

So if this specific case occurs, ensure nextitem is called with None instead.
  • Loading branch information
yuvalino authored May 31, 2024
commit c76c0702984c9fdc49b1b30fcaac452e63090130
2 changes: 1 addition & 1 deletion src/xdist/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def run_one_test(self) -> None:

items = self.session.items
item = items[self.item_index]
if self.nextitem_index is Marker.SHUTDOWN:
if self.nextitem_index is Marker.SHUTDOWN or self.item_index == self.nextitem_index:
nextitem = None
else:
assert self.nextitem_index is not None
Expand Down