Skip to content

Commit 5c5926b

Browse files
committed
Update Pytester.runpytest_subprocess to construct args as list
1 parent 4878019 commit 5c5926b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/_pytest/pytester.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -1485,13 +1485,15 @@ def runpytest_subprocess(
14851485
The result.
14861486
"""
14871487
__tracebackhide__ = True
1488+
pytest_args = list(self._getpytestargs())
1489+
for plugin in self.plugins:
1490+
if isinstance(plugin, str):
1491+
pytest_args += ["-p", plugin]
1492+
14881493
p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700)
1489-
args = (f"--basetemp={p}", *args)
1490-
plugins = [x for x in self.plugins if isinstance(x, str)]
1491-
for plugin in reversed(plugins):
1492-
args = ("-p", plugin, *args)
1493-
args = self._getpytestargs() + args
1494-
return self.run(*args, timeout=timeout)
1494+
pytest_args.append(f"--basetemp={p}")
1495+
1496+
return self.run(*pytest_args, *args, timeout=timeout)
14951497

14961498
def spawn_pytest(self, string: str, expect_timeout: float = 10.0) -> pexpect.spawn:
14971499
"""Run pytest using pexpect.

0 commit comments

Comments
 (0)