Skip to content

Commit f747f77

Browse files
committed
TST: disable pip version check for all tests
1 parent 7e4d6a7 commit f747f77

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ def fixture(tmp_dir_session):
123123
globals()[f'wheel_{normalized}'] = generate_wheel_fixture(package)
124124

125125

126+
@pytest.fixture(autouse=True, scope='session')
127+
def disable_pip_version_check():
128+
# Cannot use the 'monkeypatch' fixture because of scope mismatch.
129+
mpatch = pytest.MonkeyPatch()
130+
yield mpatch.setenv('PIP_DISABLE_PIP_VERSION_CHECK', '1')
131+
mpatch.undo()
132+
133+
126134
@pytest.fixture(scope='session')
127135
def pep518_wheelhouse(tmpdir_factory):
128136
wheelhouse = tmpdir_factory.mktemp('wheelhouse')

tests/docs/examples/test_spam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_build_and_import(venv, tmp_dir_session):
2020
wheel = build_project_wheel(package=examples_dir / 'spam', outdir=tmp_dir_session)
2121

2222
subprocess.check_call([
23-
venv.executable, '-m', 'pip', '--disable-pip-version-check', 'install', wheel
23+
venv.executable, '-m', 'pip', 'install', wheel
2424
])
2525
output = subprocess.check_output([
2626
venv.executable, '-c', 'import spam; print(spam.add(1, 2))'

tests/test_wheel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_configure_data(wheel_configure_data):
142142
@pytest.mark.skipif(platform.system() != 'Linux', reason='Unsupported on this platform for now')
143143
def test_local_lib(venv, wheel_link_against_local_lib):
144144
subprocess.check_call([
145-
venv.executable, '-m', 'pip', '--disable-pip-version-check', 'install', wheel_link_against_local_lib
145+
venv.executable, '-m', 'pip', 'install', wheel_link_against_local_lib
146146
])
147147
assert subprocess.check_output([
148148
venv.executable, '-c', 'import example; print(example.example_sum(1, 2))'

0 commit comments

Comments
 (0)