Skip to content

Commit 60d3c04

Browse files
committed
Skip tests that do not make sense on Python 3.12+
1 parent 4a014f9 commit 60d3c04

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

tests/functional/test_install.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -848,14 +848,18 @@ def test_editable_install__local_dir_no_setup_py(
848848
)
849849

850850

851+
@pytest.mark.skipif(
852+
sys.version_info >= (3, 12),
853+
reason="Setuptools<64 does not support Python 3.12+",
854+
)
851855
@pytest.mark.network
852-
def test_editable_install__local_dir_no_setup_py_with_pyproject(
856+
def test_editable_install_legacy__local_dir_no_setup_py_with_pyproject(
853857
script: PipTestEnvironment,
854858
) -> None:
855859
"""
856-
Test installing in editable mode from a local directory with no setup.py
857-
but that does have pyproject.toml with a build backend that does not support
858-
the build_editable hook.
860+
Test installing in legacy editable mode from a local directory with no
861+
setup.py but that does have pyproject.toml with a build backend that does
862+
not support the build_editable hook.
859863
"""
860864
local_dir = script.scratch_path.joinpath("temp")
861865
local_dir.mkdir()
@@ -1383,8 +1387,14 @@ def test_install_editable_with_prefix_setup_py(script: PipTestEnvironment) -> No
13831387
_test_install_editable_with_prefix(script, {"setup.py": setup_py})
13841388

13851389

1390+
@pytest.mark.skipif(
1391+
sys.version_info >= (3, 12),
1392+
reason="Setuptools<64 does not support Python 3.12+",
1393+
)
13861394
@pytest.mark.network
1387-
def test_install_editable_with_prefix_setup_cfg(script: PipTestEnvironment) -> None:
1395+
def test_install_editable_legacy_with_prefix_setup_cfg(
1396+
script: PipTestEnvironment,
1397+
) -> None:
13881398
setup_cfg = """[metadata]
13891399
name = pkga
13901400
version = 0.1

tests/functional/test_uninstall.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def test_basic_uninstall(script: PipTestEnvironment) -> None:
3737
assert_all_changes(result, result2, [script.venv / "build", "cache"])
3838

3939

40+
@pytest.mark.skipif(
41+
sys.version_info >= (3, 12),
42+
reason="distutils is no longer available in Python 3.12+",
43+
)
4044
def test_basic_uninstall_distutils(script: PipTestEnvironment) -> None:
4145
"""
4246
Test basic install and uninstall.
@@ -68,6 +72,10 @@ def test_basic_uninstall_distutils(script: PipTestEnvironment) -> None:
6872
) in result.stderr
6973

7074

75+
@pytest.mark.skipif(
76+
sys.version_info >= (3, 12),
77+
reason="Setuptools<64 does not support Python 3.12+",
78+
)
7179
@pytest.mark.network
7280
def test_basic_uninstall_with_scripts(script: PipTestEnvironment) -> None:
7381
"""
@@ -101,6 +109,10 @@ def test_uninstall_invalid_parameter(
101109
assert expected_message in result.stderr
102110

103111

112+
@pytest.mark.skipif(
113+
sys.version_info >= (3, 12),
114+
reason="Setuptools<64 does not support Python 3.12+",
115+
)
104116
@pytest.mark.network
105117
def test_uninstall_easy_install_after_import(script: PipTestEnvironment) -> None:
106118
"""
@@ -126,6 +138,10 @@ def test_uninstall_easy_install_after_import(script: PipTestEnvironment) -> None
126138
)
127139

128140

141+
@pytest.mark.skipif(
142+
sys.version_info >= (3, 12),
143+
reason="Setuptools<64 does not support Python 3.12+",
144+
)
129145
@pytest.mark.network
130146
def test_uninstall_trailing_newline(script: PipTestEnvironment) -> None:
131147
"""
@@ -337,6 +353,10 @@ def test_uninstall_console_scripts_uppercase_name(script: PipTestEnvironment) ->
337353
assert not script_name.exists()
338354

339355

356+
@pytest.mark.skipif(
357+
sys.version_info >= (3, 12),
358+
reason="Setuptools<64 does not support Python 3.12+",
359+
)
340360
@pytest.mark.network
341361
def test_uninstall_easy_installed_console_scripts(script: PipTestEnvironment) -> None:
342362
"""

0 commit comments

Comments
 (0)