Skip to content

Commit

Permalink
tests: add test_plugin_loading_order
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jan 22, 2020
1 parent 0f78ef8 commit 8a74153
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions testing/test_config.py
Expand Up @@ -670,6 +670,28 @@ def distributions():
assert has_loaded == should_load


def test_plugin_loading_order(testdir):
p1 = testdir.makepyfile(
"""
def test_terminal_plugin(request):
import myplugin
assert myplugin.terminal_plugin
""",
**{
"myplugin": """
terminal_plugin = False
def pytest_configure(config):
global terminal_plugin
terminal_plugin = config.pluginmanager.get_plugin("terminalreporter")
"""
}
)
testdir.syspathinsert()
result = testdir.runpytest("-p", "myplugin", str(p1))
assert result.ret == 0


def test_cmdline_processargs_simple(testdir):
testdir.makeconftest(
"""
Expand Down

0 comments on commit 8a74153

Please sign in to comment.