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

Method test_invoke_plugin_api

testing/acceptance_test.py:651–658  ·  view source on GitHub ↗
(self, capsys)

Source from the content-addressed store, hash-verified

649 assert retcode == ExitCode.NO_TESTS_COLLECTED
650
651 def test_invoke_plugin_api(self, capsys) -> None:
652 class MyPlugin:
653 def pytest_addoption(self, parser):
654 parser.addoption("--myopt")
655
656 pytest.main(["-h"], plugins=[MyPlugin()])
657 out, _err = capsys.readouterr()
658 assert "--myopt" in out
659
660 def test_pyargs_importerror(self, pytester: Pytester, monkeypatch) -> None:
661 monkeypatch.delenv("PYTHONDONTWRITEBYTECODE", False)

Callers

nothing calls this directly

Calls 2

MyPluginClass · 0.70
readouterrMethod · 0.45

Tested by

no test coverage detected