(tox_project: ToxProjectCreator, mocker: MockFixture)
| 26 | |
| 27 | |
| 28 | def test_version_with_plugin(tox_project: ToxProjectCreator, mocker: MockFixture) -> None: |
| 29 | dist = [ |
| 30 | ( |
| 31 | mocker.create_autospec("types.ModuleType", __file__="B-path", tox_append_version_info=lambda: "magic"), |
| 32 | SimpleNamespace(project_name="B", version="1.0"), |
| 33 | ), |
| 34 | ( |
| 35 | mocker.create_autospec("types.ModuleType", __file__="A-path"), |
| 36 | SimpleNamespace(project_name="A", version="2.0"), |
| 37 | ), |
| 38 | ] |
| 39 | mocker.patch.object(MANAGER.manager, "list_plugin_distinfo", return_value=dist) |
| 40 | |
| 41 | outcome = tox_project({"tox.ini": ""}).run("--version") |
| 42 | |
| 43 | outcome.assert_success() |
| 44 | assert not outcome.err |
| 45 | lines = outcome.out.splitlines() |
| 46 | assert lines[0].startswith(__version__) |
| 47 | |
| 48 | assert lines[1:] == [ |
| 49 | "registered plugins:", |
| 50 | " B-1.0 at B-path magic", |
| 51 | " A-2.0 at A-path", |
| 52 | ] |
| 53 | |
| 54 | |
| 55 | @pytest.mark.plugin_test |
nothing calls this directly
no test coverage detected
searching dependent graphs…