diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-01-16 16:36:47 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-01-16 16:36:47 -0500 |
commit | a499dee61ecdabf867853f24a2bc78a8197c97f1 (patch) | |
tree | 597e6e5b843b130b7ddeb4291f76c34582228ce3 | |
parent | fa6229bd7e35b18a07e36377ad7a5551b38a786c (diff) | |
download | python-setuptools-git-a499dee61ecdabf867853f24a2bc78a8197c97f1.tar.gz |
Avoid hitting network during test_easy_install
-rw-r--r-- | changelog.d/2525.misc.rst | 1 | ||||
-rw-r--r-- | setuptools/tests/test_easy_install.py | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/changelog.d/2525.misc.rst b/changelog.d/2525.misc.rst new file mode 100644 index 00000000..50d1bfa1 --- /dev/null +++ b/changelog.d/2525.misc.rst @@ -0,0 +1 @@ +Avoid hitting network during test_easy_install. diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index dc00e697..93ac23e4 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -38,6 +38,16 @@ from .files import build_files from .textwrap import DALS +@pytest.fixture(autouse=True) +def pip_disable_index(monkeypatch): + """ + Important: Disable the default index for pip to avoid + querying packages in the index and potentially resolving + and installing packages there. + """ + monkeypatch.setenv('PIP_NO_INDEX', 'true') + + class FakeDist: def get_entry_map(self, group): if group != 'console_scripts': |