diff options
Diffstat (limited to 'setuptools')
| -rw-r--r-- | setuptools/tests/test_editable_install.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py index 4406eda5..ac574c0e 100644 --- a/setuptools/tests/test_editable_install.py +++ b/setuptools/tests/test_editable_install.py @@ -21,6 +21,7 @@ from . import contexts, namespaces from setuptools._importlib import resources as importlib_resources from setuptools.command.editable_wheel import ( + _DebuggingTips, _LinkTree, _find_virtual_namespaces, _find_namespaces, @@ -955,6 +956,24 @@ class TestCustomBuildExt: assert any(name.endswith(ext) for ext in EXTENSION_SUFFIXES) +def test_debugging_tips(tmpdir_cwd, monkeypatch): + """Make sure to display useful debugging tips to the user.""" + jaraco.path.build({"module.py": "x = 42"}) + dist = Distribution() + dist.script_name = "setup.py" + dist.set_defaults() + cmd = editable_wheel(dist) + cmd.ensure_finalized() + + SimulatedErr = type("SimulatedErr", (Exception,), {}) + simulated_failure = Mock(side_effect=SimulatedErr()) + monkeypatch.setattr(cmd, "get_finalized_command", simulated_failure) + + expected_msg = "following steps are recommended to help debugging" + with pytest.raises(SimulatedErr), pytest.warns(_DebuggingTips, match=expected_msg): + cmd.run() + + def install_project(name, venv, tmp_path, files, *opts): project = tmp_path / name project.mkdir() |
