Created
August 31, 2012 16:56
-
-
Save klrmn/3555808 to your computer and use it in GitHub Desktop.
run this before and after installing pytest-xdist in the environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pytest_terminal_summary(terminalreporter): | |
config = terminalreporter.config | |
if not test_cases or config.option.verbose < 1: | |
return | |
tw = terminalreporter._tw | |
tw.sep('-', 'this line will not show up with -n 1') | |
tw.line('this line should show up') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pytest_plugins = 'pytester' | |
def test_terminal_summary_with_xdist_dash_n(testdir): | |
try: | |
result = testdir.runpytest('--version') | |
result.stderr.fnmatch_lines(['*pytest-xdist*']) | |
except Exception: | |
import pytest | |
pytest.skip("this test requires pytest-xdist") | |
testdir.makepyfile(""" | |
import pytest | |
def test_whatever(): | |
pass | |
""") | |
result = testdir.runpytest('--verbose', '-n 1') | |
result.stdout.fnmatch_lines(['*this line will not show up with -n 1*', | |
'*this line should show up*']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment