Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 3d2ffe9

Browse files
committed
debug
1 parent 9487858 commit 3d2ffe9

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

foo.patch

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py
2-
index 9fe8b0f95..f1ee5723d 100644
2+
index e76315299..9be107f9c 100644
33
--- a/pandas/tests/test_downstream.py
44
+++ b/pandas/tests/test_downstream.py
5-
@@ -135,11 +135,15 @@ def test_pyarrow(df):
6-
7-
def test_missing_required_dependency():
8-
# GH 23868
9-
- # use the -S flag to disable site-packages
10-
- call = ['python', '-S', '-c', 'import pandas']
11-
+ # To ensure proper isolation, we pass these flags
12-
+ # -S : disable site-packages
13-
+ # -s : disable user site-packages
14-
+ # -E : disable PYTHON* env vars, especially PYTHONPATH
15-
+ call = ['python', '-S', '-s', '-E', '-c', 'import pandas']
5+
@@ -139,7 +139,19 @@ def test_missing_required_dependency():
6+
# -S : disable site-packages
7+
# -s : disable user site-packages
8+
# -E : disable PYTHON* env vars, especially PYTHONPATH
9+
- call = ['python', '-S', '-s', '-E', '-c', 'import pandas']
10+
+ # And, that's apparently not enough, so we give up.
11+
+ # https://github.com/MacPython/pandas-wheels/pull/50
12+
+ try:
13+
+ subprocess.check_output(['python', '-sSE', '-c', 'import numpy'],
14+
+ stderr=subprocess.DEVNULL)
15+
+ except subprocess.CalledProcessError:
16+
+ # NumPy is not around, we can do the test
17+
+ pass
18+
+ else:
19+
+ # NumPy is in the isolation environment, give up.
20+
+ pytest.skip("Required dependencies in isolated environment.")
21+
+
22+
+ call = ['python', '-sSE', '-c', 'import pandas']
1623

1724
with pytest.raises(subprocess.CalledProcessError) as exc:
1825
subprocess.check_output(call, stderr=subprocess.STDOUT)
19-
20-
output = exc.value.stdout.decode()
21-
+ assert output == b'123'
22-
assert all(x in output for x in ['numpy', 'pytz', 'dateutil'])

0 commit comments

Comments
 (0)