|
1 | 1 | diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py
|
2 |
| -index 9fe8b0f95..f1ee5723d 100644 |
| 2 | +index e76315299..9be107f9c 100644 |
3 | 3 | --- a/pandas/tests/test_downstream.py
|
4 | 4 | +++ 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'] |
16 | 23 |
|
17 | 24 | with pytest.raises(subprocess.CalledProcessError) as exc:
|
18 | 25 | 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