Skip to content

Commit c3084d3

Browse files
committed
pytester: fix subprocess mode ignores all pytester.plugins except the first
As far as I can see, there is no reason for this, seems like a mistake.
1 parent b3ee80b commit c3084d3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

changelog/13522.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed :fixture:`pytester` in subprocess mode ignored all :attr`pytester.plugins <pytest.Pytester.plugins>` except the first.

src/_pytest/pytester.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,9 +1494,9 @@ def runpytest_subprocess(
14941494
__tracebackhide__ = True
14951495
p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700)
14961496
args = (f"--basetemp={p}", *args)
1497-
plugins = [x for x in self.plugins if isinstance(x, str)]
1498-
if plugins:
1499-
args = ("-p", plugins[0], *args)
1497+
for plugin in self.plugins:
1498+
if isinstance(plugin, str):
1499+
args = ("-p", plugin, *args)
15001500
args = self._getpytestargs() + args
15011501
return self.run(*args, timeout=timeout)
15021502

0 commit comments

Comments
 (0)