|
9 | 9 |
|
10 | 10 | import pytest |
11 | 11 |
|
12 | | -import py_discovery._compat |
13 | 12 | from py_discovery import DiskCache, PythonInfo, PythonSpec |
14 | 13 | from py_discovery._py_info import VersionInfo |
15 | 14 |
|
@@ -465,23 +464,23 @@ def test_possible_base_python_basename(mocker) -> None: |
465 | 464 | assert "cpython" in names |
466 | 465 |
|
467 | 466 |
|
468 | | -def test_possible_base_case_sensitive(monkeypatch: pytest.MonkeyPatch) -> None: |
| 467 | +def test_possible_base_case_sensitive(mocker) -> None: |
469 | 468 | info = copy.deepcopy(CURRENT) |
470 | 469 | info.executable = "/usr/bin/CPython3.12" |
471 | 470 | info.implementation = "CPython" |
472 | | - monkeypatch.setattr(py_discovery._compat, "fs_is_case_sensitive", lambda: True) |
| 471 | + mocker.patch("py_discovery._compat.fs_is_case_sensitive", return_value=True) |
473 | 472 | names = list(info._possible_base()) |
474 | 473 | lower_names = [n for n in names if n.islower()] |
475 | 474 | upper_names = [n for n in names if n.isupper()] |
476 | 475 | assert len(lower_names) >= 1 |
477 | 476 | assert len(upper_names) >= 1 |
478 | 477 |
|
479 | 478 |
|
480 | | -def test_possible_base_case_sensitive_upper_equals_base(monkeypatch: pytest.MonkeyPatch) -> None: |
| 479 | +def test_possible_base_case_sensitive_upper_equals_base(mocker) -> None: |
481 | 480 | info = copy.deepcopy(CURRENT) |
482 | 481 | info.executable = "/usr/bin/JYTHON" |
483 | 482 | info.implementation = "JYTHON" |
484 | | - monkeypatch.setattr(py_discovery._compat, "fs_is_case_sensitive", lambda: True) |
| 483 | + mocker.patch("py_discovery._compat.fs_is_case_sensitive", return_value=True) |
485 | 484 | names = list(info._possible_base()) |
486 | 485 | assert "jython" in names |
487 | 486 | assert "JYTHON" in names |
|
0 commit comments