MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_none_help_param_raises_exception

Function test_none_help_param_raises_exception

testing/test_helpconfig.py:48–59  ·  view source on GitHub ↗

Test that a None help param raises a TypeError.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

46
47
48def test_none_help_param_raises_exception(pytester: Pytester) -> None:
49 """Test that a None help param raises a TypeError."""
50 pytester.makeconftest(
51 """
52 def pytest_addoption(parser):
53 parser.addini("test_ini", None, default=True, type="bool")
54 """
55 )
56 result = pytester.runpytest("--help")
57 result.stderr.fnmatch_lines(
58 ["*TypeError: help argument cannot be None for test_ini*"]
59 )
60
61
62def test_empty_help_param(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makeconftestMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected