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

Function test_plugin_loading_order

testing/test_config.py:1705–1726  ·  testing/test_config.py::test_plugin_loading_order

Test order of plugin loading with `-p`.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1703
1704
1705def test_plugin_loading_order(pytester: Pytester) -> None:
1706 class="st">""class="st">"Test order of plugin loading with `-p`."class="st">""
1707 p1 = pytester.makepyfile(
1708 class="st">"""
1709 def test_terminal_plugin(request):
1710 import myplugin
1711 assert myplugin.terminal_plugin == [False, True]
1712 class="st">""",
1713 myplugin=class="st">"""
1714 terminal_plugin = []
1715
1716 def pytest_configure(config):
1717 terminal_plugin.append(bool(config.pluginmanager.get_plugin(class="st">"terminalreporter")))
1718
1719 def pytest_sessionstart(session):
1720 config = session.config
1721 terminal_plugin.append(bool(config.pluginmanager.get_plugin(class="st">"terminalreporter")))
1722 class="st">""",
1723 )
1724 pytester.syspathinsert()
1725 result = pytester.runpytest(class="st">"-p", class="st">"myplugin", str(p1))
1726 assert result.ret == 0
1727
1728
1729def test_invalid_options_show_extra_information(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

makepyfileMethod · 0.45
syspathinsertMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected