From 70b77ae3326b488a00b736320055cf1815167d3d Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Tue, 11 Jul 2023 11:12:02 -0400 Subject: [PATCH] Fix failing test --- tests/integration/conftest.py | 4 +++- tests/integration/test_uninstall.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 4f7e7e7ec3..76f9a9d551 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -24,6 +24,8 @@ HAS_WARNED_GITHUB = False +DEFAULT_PRIVATE_PYPI_SERVER = os.environ.get("PIPENV_PYPI_SERVER", "http://localhost:8080/simple") + def try_internet(url="http://httpbin.org/ip", timeout=1.5): resp = requests.get(url, timeout=timeout) @@ -321,7 +323,7 @@ def pipenv_instance_private_pypi(capfdbinary, monkeypatch): warnings.simplefilter("ignore", category=ResourceWarning) warnings.filterwarnings("ignore", category=ResourceWarning, message="unclosed.*") try: - yield functools.partial(_PipenvInstance, capfd=capfdbinary, index_url="http://localhost:8080/simple") + yield functools.partial(_PipenvInstance, capfd=capfdbinary, index_url=DEFAULT_PRIVATE_PYPI_SERVER) finally: os.umask(original_umask) diff --git a/tests/integration/test_uninstall.py b/tests/integration/test_uninstall.py index 873cbf3dc8..3956901ab2 100644 --- a/tests/integration/test_uninstall.py +++ b/tests/integration/test_uninstall.py @@ -1,5 +1,6 @@ import pytest +from .conftest import DEFAULT_PRIVATE_PYPI_SERVER from pipenv.utils.shell import temp_environ @@ -54,7 +55,7 @@ def test_uninstall_django(pipenv_instance_private_pypi): def test_mirror_uninstall(pipenv_instance_pypi): with temp_environ(), pipenv_instance_pypi() as p: - mirror_url = p.index_url + mirror_url = DEFAULT_PRIVATE_PYPI_SERVER assert "pypi.org" not in mirror_url c = p.pipenv(f"install Django --pypi-mirror {mirror_url}")