MCPcopy Index your code
hub / github.com/pytest-dev/pytest / test_plugin_loading_order

Function test_plugin_loading_order

testing/test_config.py:1705–1726  ·  view source on GitHub ↗

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 """Test order of plugin loading with `-p`."""
1707 p1 = pytester.makepyfile(
1708 """
1709 def test_terminal_plugin(request):
1710 import myplugin
1711 assert myplugin.terminal_plugin == [False, True]
1712 """,
1713 myplugin="""
1714 terminal_plugin = []
1715
1716 def pytest_configure(config):
1717 terminal_plugin.append(bool(config.pluginmanager.get_plugin("terminalreporter")))
1718
1719 def pytest_sessionstart(session):
1720 config = session.config
1721 terminal_plugin.append(bool(config.pluginmanager.get_plugin("terminalreporter")))
1722 """,
1723 )
1724 pytester.syspathinsert()
1725 result = pytester.runpytest("-p", "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

Used in the wild real call sites across dependent graphs

searching dependent graphs…