File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,18 @@ def test_missing_required_dependency():
150150 # https://github.com/MacPython/pandas-wheels/pull/50
151151
152152 pyexe = sys .executable .replace ("\\ " , "/" )
153+
154+ # We skip this test if pandas is installed as a site package. We first
155+ # import the package normally and check the path to the module before
156+ # executing the test which imports pandas with site packages disabled.
157+ call = [pyexe , "-c" , "import pandas;print(pandas.__file__)" ]
158+ output = subprocess .check_output (call ).decode ()
159+ if "site-packages" in output :
160+ pytest .skip ("pandas installed as site package" )
161+
162+ # This test will fail if pandas is installed as a site package. The flags
163+ # prevent pandas being imported and the test will report Failed: DID NOT
164+ # RAISE <class 'subprocess.CalledProcessError'>
153165 call = [pyexe , "-sSE" , "-c" , "import pandas" ]
154166
155167 msg = (
You can’t perform that action at this time.
0 commit comments