diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-02-13 18:44:58 +0000 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-02-13 18:44:58 +0000 |
| commit | 65e3a8c6a7ae9753be79efe4a8772b28435e452c (patch) | |
| tree | 6ad24d66d6a79d0bd55902f3eff3dd0f6eb4b38f /setuptools/tests | |
| parent | f974efe2853e8520521e479759ecec09fd55cba4 (diff) | |
| download | python-setuptools-git-65e3a8c6a7ae9753be79efe4a8772b28435e452c.tar.gz | |
Add test for debugging tips
Diffstat (limited to 'setuptools/tests')
| -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() |
