Test order of plugin loading with `-p`.
(pytester: Pytester)
| 1102 | |
| 1103 | |
| 1104 | def test_plugin_loading_order(pytester: Pytester) -> None: |
| 1105 | """Test order of plugin loading with `-p`.""" |
| 1106 | p1 = pytester.makepyfile( |
| 1107 | """ |
| 1108 | def test_terminal_plugin(request): |
| 1109 | import myplugin |
| 1110 | assert myplugin.terminal_plugin == [False, True] |
| 1111 | """, |
| 1112 | **{ |
| 1113 | "myplugin": """ |
| 1114 | terminal_plugin = [] |
| 1115 | |
| 1116 | def pytest_configure(config): |
| 1117 | terminal_plugin.append(bool(config.pluginmanager.get_plugin("terminalreporter"))) |
| 1118 | |
| 1119 | def pytest_sessionstart(session): |
| 1120 | config = session.config |
| 1121 | terminal_plugin.append(bool(config.pluginmanager.get_plugin("terminalreporter"))) |
| 1122 | """ |
| 1123 | }, |
| 1124 | ) |
| 1125 | pytester.syspathinsert() |
| 1126 | result = pytester.runpytest("-p", "myplugin", str(p1)) |
| 1127 | assert result.ret == 0 |
| 1128 | |
| 1129 | |
| 1130 | def test_cmdline_processargs_simple(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected