MCPcopy
hub / github.com/tox-dev/tox / test_version_with_plugin

Function test_version_with_plugin

tests/test_version.py:28–52  ·  view source on GitHub ↗
(tox_project: ToxProjectCreator, mocker: MockFixture)

Source from the content-addressed store, hash-verified

26
27
28def 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

Callers

nothing calls this directly

Calls 2

runMethod · 0.45
assert_successMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…