Skip to content

Commit aa0aa04

Browse files
henryiiilayday
authored andcommitted
fix(types): make the passthrough general
Signed-off-by: Henry Schreiner <[email protected]>
1 parent af5ff53 commit aa0aa04

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/build/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _minimum_pip_version() -> str:
7070
return '19.1.0'
7171

7272

73-
def _has_valid_pip(**distargs: str) -> bool:
73+
def _has_valid_pip(**distargs: object) -> bool:
7474
"""
7575
Given a path, see if Pip is present and return True if the version is
7676
sufficient for build, False if it is not.

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ def is_integration(item):
6565
return os.path.basename(item.location[0]) == 'test_integration.py'
6666

6767

68+
@pytest.fixture()
69+
def local_pip(monkeypatch):
70+
monkeypatch.setattr(build.env, '_valid_global_pip', lambda: None)
71+
72+
6873
@pytest.fixture(scope='session', autouse=True)
6974
def ensure_syconfig_vars_created():
7075
# the config vars are globally cached and may use get_path, make sure they are created

tests/test_env.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def test_isolation():
2626

2727

2828
@pytest.mark.isolated
29+
@pytest.mark.usefixtures('local_pip')
2930
def test_isolated_environment_install(mocker):
3031
with build.env.DefaultIsolatedEnv() as env:
3132
mocker.patch('build.env._subprocess')
@@ -117,6 +118,7 @@ def test_isolated_env_log(mocker, caplog, package_test_flit):
117118

118119

119120
@pytest.mark.isolated
121+
@pytest.mark.usefixtures('local_pip')
120122
def test_default_pip_is_never_too_old():
121123
with build.env.DefaultIsolatedEnv() as env:
122124
version = subprocess.check_output(
@@ -130,6 +132,7 @@ def test_default_pip_is_never_too_old():
130132
@pytest.mark.isolated
131133
@pytest.mark.parametrize('pip_version', ['20.2.0', '20.3.0', '21.0.0', '21.0.1'])
132134
@pytest.mark.parametrize('arch', ['x86_64', 'arm64'])
135+
@pytest.mark.usefixtures('local_pip')
133136
def test_pip_needs_upgrade_mac_os_11(mocker, pip_version, arch):
134137
SimpleNamespace = collections.namedtuple('SimpleNamespace', 'version')
135138

tests/test_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def main_reload_styles():
342342
],
343343
ids=['no-color', 'color'],
344344
)
345+
@pytest.mark.usefixtures('local_pip')
345346
def test_output_env_subprocess_error(
346347
mocker,
347348
monkeypatch,

0 commit comments

Comments
 (0)