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

Function test_invalid_options_show_extra_information

testing/test_config.py:1729–1745  ·  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

1727
1728
1729def test_invalid_options_show_extra_information(pytester: Pytester) -> None:
1730 """Display extra information when pytest exits due to unrecognized
1731 options in the command-line."""
1732 pytester.makeini(
1733 """
1734 [pytest]
1735 addopts = --invalid-option
1736 """
1737 )
1738 result = pytester.runpytest()
1739 result.stderr.fnmatch_lines(
1740 [
1741 "*error: unrecognized arguments: --invalid-option*",
1742 "* inifile: {}*".format(pytester.path.joinpath("tox.ini")),
1743 f"* rootdir: {pytester.path}*",
1744 ]
1745 )
1746
1747
1748@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
makeiniMethod · 0.45
runpytestMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…