diff options
author | Daniel Hahler <git@thequod.de> | 2019-03-27 19:10:33 +0100 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-04-02 14:39:56 +0200 |
commit | 8c734dfc2f98e617ca7796ab0af74abdb747a34c (patch) | |
tree | bc8d56a759c91cc0d52b28e729f56f408c8d29d3 /testing/test_config.py | |
parent | 407d74be274609c5b750d68f4031f5c1d3b6d4b0 (diff) | |
download | pytest-8c734dfc2f98e617ca7796ab0af74abdb747a34c.tar.gz |
Split out list of essential plugins
Fixes https://github.com/pytest-dev/pytest/issues/4976.
Diffstat (limited to 'testing/test_config.py')
-rw-r--r-- | testing/test_config.py | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/testing/test_config.py b/testing/test_config.py index c90333a00..8cd606f45 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1205,20 +1205,12 @@ def test_config_does_not_load_blocked_plugin_from_args(testdir): [ x for x in _pytest.config.default_plugins - if x - not in [ - "fixtures", - "helpconfig", # Provides -p. - "main", - "mark", - "python", - "runner", - "terminal", # works in OK case (no output), but not with failures. - ] + if x not in _pytest.config.essential_plugins ], ) def test_config_blocked_default_plugins(testdir, plugin): if plugin == "debugging": + # Fixed in xdist master (after 1.27.0). # https://github.com/pytest-dev/pytest-xdist/pull/422 try: import xdist # noqa: F401 @@ -1230,9 +1222,11 @@ def test_config_blocked_default_plugins(testdir, plugin): p = testdir.makepyfile("def test(): pass") result = testdir.runpytest(str(p), "-pno:%s" % plugin) assert result.ret == EXIT_OK - result.stdout.fnmatch_lines(["* 1 passed in *"]) - - p = testdir.makepyfile("def test(): assert 0") - result = testdir.runpytest(str(p), "-pno:%s" % plugin) - assert result.ret == EXIT_TESTSFAILED - result.stdout.fnmatch_lines(["* 1 failed in *"]) + if plugin != "terminal": + result.stdout.fnmatch_lines(["* 1 passed in *"]) + + if plugin != "terminal": # fails to report due to its options being used elsewhere. + p = testdir.makepyfile("def test(): assert 0") + result = testdir.runpytest(str(p), "-pno:%s" % plugin) + assert result.ret == EXIT_TESTSFAILED + result.stdout.fnmatch_lines(["* 1 failed in *"]) |