Skip to content

Commit a1e983a

Browse files
committed
Test there is no fallback when backend has no PEP 660
1 parent 13eba86 commit a1e983a

File tree

1 file changed

+8
-34
lines changed

1 file changed

+8
-34
lines changed

tests/functional/test_pep660.py

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,11 @@ def test_install_pep660_from_reqs_file(
164164
), "a .egg-link file should not have been created"
165165

166166

167-
def test_install_no_pep660_setup_py_fallback(
168-
tmpdir: Path, script: PipTestEnvironment
169-
) -> None:
167+
def test_install_no_pep660(tmpdir: Path, script: PipTestEnvironment) -> None:
170168
"""
171-
Test that we fall back to setuptools develop when using a backend that
172-
does not support build_editable. Since there is a pyproject.toml,
173-
the prepare_metadata_for_build_wheel hook is called.
169+
Test the error message when the build backend does not support PEP 660.
170+
Since there is a pyproject.toml, the prepare_metadata_for_build_wheel hook
171+
is called.
174172
"""
175173
project_dir = _make_project(tmpdir, BACKEND_WITHOUT_PEP660, with_setup_py=True)
176174
result = script.pip(
@@ -179,38 +177,14 @@ def test_install_no_pep660_setup_py_fallback(
179177
"--no-build-isolation",
180178
"--editable",
181179
project_dir,
182-
allow_stderr_warning=False,
180+
allow_error=True,
183181
)
182+
assert result.returncode != 0
184183
_assert_hook_called(project_dir, "prepare_metadata_for_build_wheel")
185184
assert (
186-
result.test_env.site_packages.joinpath("project.egg-link")
187-
in result.files_created
188-
), "a .egg-link file should have been created"
189-
190-
191-
def test_install_no_pep660_setup_cfg_fallback(
192-
tmpdir: Path, script: PipTestEnvironment
193-
) -> None:
194-
"""
195-
Test that we fall back to setuptools develop when using a backend that
196-
does not support build_editable. Since there is a pyproject.toml,
197-
the prepare_metadata_for_build_wheel hook is called.
198-
"""
199-
project_dir = _make_project(tmpdir, BACKEND_WITHOUT_PEP660, with_setup_py=False)
200-
result = script.pip(
201-
"install",
202-
"--no-index",
203-
"--no-build-isolation",
204-
"--editable",
205-
project_dir,
206-
allow_stderr_warning=False,
185+
"Cannot build editable project because "
186+
"the build backend does not have the build_editable hook" in result.stderr
207187
)
208-
print(result.stdout, result.stderr)
209-
_assert_hook_called(project_dir, "prepare_metadata_for_build_wheel")
210-
assert (
211-
result.test_env.site_packages.joinpath("project.egg-link")
212-
in result.files_created
213-
), ".egg-link file should have been created"
214188

215189

216190
def test_wheel_editable_pep660_basic(tmpdir: Path, script: PipTestEnvironment) -> None:

0 commit comments

Comments
 (0)