diff options
author | Stephen Finucane <stephen@that.guru> | 2017-12-22 18:50:49 +0000 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2017-12-29 13:02:07 +0000 |
commit | c33ecd1f8f1ea6eb7e410e91aec754bdd1d1f20a (patch) | |
tree | e259637bb3bd19b21def3604e064363fec931996 | |
parent | 9348c4bea1bf75184bb4fe2af25c5990d6dcf2c1 (diff) | |
download | sphinx-git-c33ecd1f8f1ea6eb7e410e91aec754bdd1d1f20a.tar.gz |
tests: Use 'pytest_report_header'
This is the recommended way to print extra headers [1].
[1] https://docs.pytest.org/en/latest/example/simple.html#adding-info-to-test-report-header
Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r-- | tests/conftest.py | 5 | ||||
-rwxr-xr-x | tests/run.py | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 9ea99dbd9..d50d76df0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,3 +26,8 @@ if sys.version_info < (3, 5): @pytest.fixture(scope='session') def rootdir(): return path(os.path.dirname(__file__) or '.').abspath() / 'roots' + + +def pytest_report_header(config): + return 'Running Sphinx test suite (with Python %s)...' % ( + sys.version.split()[0]) diff --git a/tests/run.py b/tests/run.py index 217f8bea2..aa797dbdb 100755 --- a/tests/run.py +++ b/tests/run.py @@ -39,8 +39,5 @@ if os.path.exists(tempdir): shutil.rmtree(tempdir) os.makedirs(tempdir) -print('Running Sphinx test suite (with Python %s)...' % sys.version.split()[0]) -sys.stdout.flush() - import pytest # NOQA sys.exit(pytest.main(sys.argv[1:])) |