Skip to content

Commit

Permalink
TST: Add some for helpers and fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Dec 2, 2024
1 parent f8686ee commit 7c47690
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,3 +562,14 @@ def test_construct_pip_call(declaration, expected_result):
])
def test_replace_cpython_version(arg, new_version, expected):
assert util.replace_cpython_version(arg, new_version) == expected


@pytest.mark.parametrize("path, expected_version", [
("/home/jdoe/micromamba/envs/asv_exp/bin/python3.11", "3.11"),
("/usr/local/bin/python3.12", "3.12"),
("/opt/anaconda3/bin/python3.9", "3.9"),
("/usr/bin/python", None),
("/home/user/custom_python/python_alpha", None),
])
def test_extract_python_version(path, expected_version):
assert util.extract_cpython_version(path) == expected_version
2 changes: 1 addition & 1 deletion test/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def basic_conf(tmpdir, dummy_packages):


@pytest.mark.skipif(tools.HAS_PYPY or (os.name == 'nt'), reason="Flaky on pypy and windows")
def test_run_publish(capfd, basic_conf):
def test_run_publish(capfd, basic_conf, request: pytest.FixtureRequest):
tmpdir, local, conf, machine_file = basic_conf
tmpdir = util.long_path(tmpdir)

Expand Down

0 comments on commit 7c47690

Please sign in to comment.