Skip to content

Commit

Permalink
Backport PR #37428: Failing test_missing_required_dependency in panda…
Browse files Browse the repository at this point in the history
…s-wheels (#37445)

Co-authored-by: Simon Hawkins <simonjayhawkins@gmail.com>
  • Loading branch information
meeseeksmachine and simonjayhawkins authored Oct 27, 2020
1 parent 5498df4 commit f87111f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pandas/tests/test_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ def test_missing_required_dependency():
# https://github.com/MacPython/pandas-wheels/pull/50

pyexe = sys.executable.replace("\\", "/")

# We skip this test if pandas is installed as a site package. We first
# import the package normally and check the path to the module before
# executing the test which imports pandas with site packages disabled.
call = [pyexe, "-c", "import pandas;print(pandas.__file__)"]
output = subprocess.check_output(call).decode()
if "site-packages" in output:
pytest.skip("pandas installed as site package")

# This test will fail if pandas is installed as a site package. The flags
# prevent pandas being imported and the test will report Failed: DID NOT
# RAISE <class 'subprocess.CalledProcessError'>
call = [pyexe, "-sSE", "-c", "import pandas"]

msg = (
Expand Down

0 comments on commit f87111f

Please sign in to comment.