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

Function test_invalid_options_show_extra_information

testing/test_config.py:1141–1157  ·  view source on GitHub ↗

Display extra information when pytest exits due to unrecognized options in the command-line.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1139
1140
1141def test_invalid_options_show_extra_information(pytester: Pytester) -> None:
1142 """Display extra information when pytest exits due to unrecognized
1143 options in the command-line."""
1144 pytester.makeini(
1145 """
1146 [pytest]
1147 addopts = --invalid-option
1148 """
1149 )
1150 result = pytester.runpytest()
1151 result.stderr.fnmatch_lines(
1152 [
1153 "*error: unrecognized arguments: --invalid-option*",
1154 "* inifile: %s*" % pytester.path.joinpath("tox.ini"),
1155 "* rootdir: %s*" % pytester.path,
1156 ]
1157 )
1158
1159
1160@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makeiniMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected