From 38758f5edd89ee05e5449891c9deb7d7feb527b9 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Thu, 13 Jan 2022 10:15:00 +0000 Subject: [PATCH] Replace skip in editable install test with xfail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … as suggested in code review --- setuptools/tests/test_editable_install.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py index 2957cba01c3..ca8288d5e6c 100644 --- a/setuptools/tests/test_editable_install.py +++ b/setuptools/tests/test_editable_install.py @@ -18,8 +18,6 @@ def venv(tmp_path, setuptools_wheel): return env.create() -SETUP_SCRIPT_STUB = "__import__('setuptools').setup()" - EXAMPLE = { 'pyproject.toml': dedent("""\ [build-system] @@ -86,11 +84,17 @@ def venv(tmp_path, setuptools_wheel): } -@pytest.mark.parametrize("setup_script", [SETUP_SCRIPT_STUB, None]) -def test_editable_with_pyproject(tmp_path, venv, setup_script): - if setup_script is None: - pytest.skip("Editable install currently only supported with `setup.py` stub") +SETUP_SCRIPT_STUB = "__import__('setuptools').setup()" +MISSING_SETUP_SCRIPT = pytest.param( + None, + marks=pytest.mark.xfail( + reason="Editable install is currently only supported with `setup.py`" + ) +) + +@pytest.mark.parametrize("setup_script", [SETUP_SCRIPT_STUB, MISSING_SETUP_SCRIPT]) +def test_editable_with_pyproject(tmp_path, venv, setup_script): project = tmp_path / "mypkg" files = {**EXAMPLE, "setup.py": setup_script} project.mkdir()