MCPcopy
hub / github.com/pytest-dev/pytest / test_version_less_verbose

Function test_version_less_verbose

testing/test_helpconfig.py:20–25  ·  testing/test_helpconfig.py::test_version_less_verbose

Single ``--version`` or ``-V`` should display only the pytest version, without loading plugins (#13574).

(pytester: Pytester, flag: str)

Source from the content-addressed store, hash-verified

18
19@pytest.mark.parametrize(class="st">"flag", [class="st">"--version", class="st">"-V"])
20def test_version_less_verbose(pytester: Pytester, flag: str) -> None:
21 class="st">""class="st">"Single ``--version`` or ``-V`` should display only the pytest version, without loading plugins (class="cm">#13574)."class="st">""
22 pytester.makeconftest(class="st">"print(&class="cm">#x27;This should not be printed')")
23 result = pytester.runpytest_subprocess(flag)
24 assert result.ret == ExitCode.OK
25 assert result.stdout.str().strip() == fclass="st">"pytest {pytest.__version__}"
26
27
28def test_versions() -> None:

Callers

nothing calls this directly

Calls 4

stripMethod · 0.80
strMethod · 0.80
makeconftestMethod · 0.45
runpytest_subprocessMethod · 0.45

Tested by

no test coverage detected