Skip to content

Commit

Permalink
Skip tests that do not make sense on Python 3.12+
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Jul 4, 2023
1 parent 4a014f9 commit 60d3c04
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,14 +848,18 @@ def test_editable_install__local_dir_no_setup_py(
)


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Setuptools<64 does not support Python 3.12+",
)
@pytest.mark.network
def test_editable_install__local_dir_no_setup_py_with_pyproject(
def test_editable_install_legacy__local_dir_no_setup_py_with_pyproject(
script: PipTestEnvironment,
) -> None:
"""
Test installing in editable mode from a local directory with no setup.py
but that does have pyproject.toml with a build backend that does not support
the build_editable hook.
Test installing in legacy editable mode from a local directory with no
setup.py but that does have pyproject.toml with a build backend that does
not support the build_editable hook.
"""
local_dir = script.scratch_path.joinpath("temp")
local_dir.mkdir()
Expand Down Expand Up @@ -1383,8 +1387,14 @@ def test_install_editable_with_prefix_setup_py(script: PipTestEnvironment) -> No
_test_install_editable_with_prefix(script, {"setup.py": setup_py})


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Setuptools<64 does not support Python 3.12+",
)
@pytest.mark.network
def test_install_editable_with_prefix_setup_cfg(script: PipTestEnvironment) -> None:
def test_install_editable_legacy_with_prefix_setup_cfg(
script: PipTestEnvironment,
) -> None:
setup_cfg = """[metadata]
name = pkga
version = 0.1
Expand Down
20 changes: 20 additions & 0 deletions tests/functional/test_uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def test_basic_uninstall(script: PipTestEnvironment) -> None:
assert_all_changes(result, result2, [script.venv / "build", "cache"])


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="distutils is no longer available in Python 3.12+",
)
def test_basic_uninstall_distutils(script: PipTestEnvironment) -> None:
"""
Test basic install and uninstall.
Expand Down Expand Up @@ -68,6 +72,10 @@ def test_basic_uninstall_distutils(script: PipTestEnvironment) -> None:
) in result.stderr


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Setuptools<64 does not support Python 3.12+",
)
@pytest.mark.network
def test_basic_uninstall_with_scripts(script: PipTestEnvironment) -> None:
"""
Expand Down Expand Up @@ -101,6 +109,10 @@ def test_uninstall_invalid_parameter(
assert expected_message in result.stderr


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Setuptools<64 does not support Python 3.12+",
)
@pytest.mark.network
def test_uninstall_easy_install_after_import(script: PipTestEnvironment) -> None:
"""
Expand All @@ -126,6 +138,10 @@ def test_uninstall_easy_install_after_import(script: PipTestEnvironment) -> None
)


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Setuptools<64 does not support Python 3.12+",
)
@pytest.mark.network
def test_uninstall_trailing_newline(script: PipTestEnvironment) -> None:
"""
Expand Down Expand Up @@ -337,6 +353,10 @@ def test_uninstall_console_scripts_uppercase_name(script: PipTestEnvironment) ->
assert not script_name.exists()


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Setuptools<64 does not support Python 3.12+",
)
@pytest.mark.network
def test_uninstall_easy_installed_console_scripts(script: PipTestEnvironment) -> None:
"""
Expand Down

0 comments on commit 60d3c04

Please sign in to comment.