Skip to content

Commit bcc4544

Browse files
committed
TST: More isolation for required dep test
Setting PYTHONPATH to include a dir with these libs breaks the test. We use -E to disable that. Closes pandas-dev#26983
1 parent 2243629 commit bcc4544

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/test_downstream.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ def test_pyarrow(df):
135135

136136
def test_missing_required_dependency():
137137
# GH 23868
138-
# use the -S flag to disable site-packages
139-
call = ['python', '-S', '-c', 'import pandas']
138+
# To ensure proper isolation, we pass these flags
139+
# -S : disable site-packages
140+
# -s : disable user site-packages
141+
# -E : disable PYTHON* env vars, especially PYTHONPATH
142+
call = ['python', '-S', '-s', '-E', '-c', 'import pandas']
140143

141144
with pytest.raises(subprocess.CalledProcessError) as exc:
142145
subprocess.check_output(call, stderr=subprocess.STDOUT)

0 commit comments

Comments
 (0)