Skip to content

Commit

Permalink
Replace skip in editable install test with xfail
Browse files Browse the repository at this point in the history
… as suggested in code review
  • Loading branch information
abravalheri committed Jan 24, 2022
1 parent 41ee6a8 commit 38758f5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions setuptools/tests/test_editable_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 38758f5

Please sign in to comment.