diff --git a/asv/environment.py b/asv/environment.py index 83113d489..ea1c4dab1 100644 --- a/asv/environment.py +++ b/asv/environment.py @@ -432,7 +432,7 @@ def get_environment_class(conf, python): classes.insert(0, cls) for cls in classes: - if cls.matches_python_fallback and cls.matches(python): + if cls.matches_python_fallback or cls.matches(python): return cls raise EnvironmentUnavailable( f"No way to create environment for python='{python}'") diff --git a/test/conftest.py b/test/conftest.py index cc4e9bba8..caca39027 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -75,6 +75,7 @@ def generate_basic_conf(tmpdir, # values not in test_dev.py copy repo_path = tools.generate_test_repo(tmpdir, values, subdir=repo_subdir).path + global env_type conf_dict = { 'env_dir': 'env', @@ -82,20 +83,21 @@ def generate_basic_conf(tmpdir, 'results_dir': 'results_workflow', 'html_dir': 'html', 'repo': relpath(repo_path), + 'environment_type': env_type, 'project': 'asv', 'conda_channels': ["conda-forge"], 'dvcs': 'git', 'matrix': { - "asv-dummy-test-package-1": [None], - "asv-dummy-test-package-2": tools.DUMMY2_VERSIONS, + "pip+asv-dummy-test-package-1": [None], + "pip+asv-dummy-test-package-2": tools.DUMMY2_VERSIONS, }, } if not dummy_packages: conf_dict['matrix'] = {} elif conf_version == 2: conf_dict['matrix'] = { - "asv_dummy_test_package_1": [""], - "asv_dummy_test_package_2": tools.DUMMY2_VERSIONS, + "pip+asv_dummy_test_package_1": [""], + "pip+asv_dummy_test_package_2": tools.DUMMY2_VERSIONS, } if repo_subdir: conf_dict['repo_subdir'] = repo_subdir @@ -112,6 +114,8 @@ def pytest_sessionstart(session): _monkeypatch_conda_lock(session.config) # Unregister unwanted environment types + # XXX: Ugly hack to get the variable into generate_basic_conf + global env_type env_type = session.config.getoption('environment_type') if env_type is not None: import asv.environment