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

Function test_version_less_verbose

testing/test_helpconfig.py:20–25  ·  view source on GitHub ↗

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("flag", ["--version", "-V"])
20def test_version_less_verbose(pytester: Pytester, flag: str) -> None:
21 """Single ``--version`` or ``-V`` should display only the pytest version, without loading plugins (#13574)."""
22 pytester.makeconftest("print('This should not be printed')")
23 result = pytester.runpytest_subprocess(flag)
24 assert result.ret == ExitCode.OK
25 assert result.stdout.str().strip() == f"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

Used in the wild real call sites across dependent graphs

searching dependent graphs…