Skip to content

Commit 63d1b28

Browse files
Chong Gaores-life
authored andcommitted
Isolate the reduced-it self-test from PYTEST_ADDOPTS
Clear PYTEST_ADDOPTS for the self-test subprocess so a caller's global pytest options (extra plugins, xdist, etc.) cannot leak into the isolated synthetic collection and perturb the result. Signed-off-by: Chong Gao <chongg@nvidia.com>
1 parent ac76ef6 commit 63d1b28

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

integration_tests/src/main/python/reduced_it_selection_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,12 @@ def _value_id(item, argname):
214214

215215
def test_reduced_it_each_choice_selection():
216216
"""Run the isolated collection self-test in a subprocess and require success."""
217+
# Clear PYTEST_ADDOPTS so a caller's global pytest options (extra plugins,
218+
# xdist, etc.) cannot leak into the isolated synthetic collection below.
219+
env = {**os.environ, "PYTEST_ADDOPTS": ""}
217220
result = subprocess.run(
218221
[sys.executable, os.path.abspath(__file__)],
219-
capture_output=True, text=True)
222+
capture_output=True, text=True, env=env)
220223
assert result.returncode == 0, (
221224
"reduced IT selection self-test failed:\n"
222225
f"stdout:\n{result.stdout}\nstderr:\n{result.stderr}")

0 commit comments

Comments
 (0)