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>
This commit is contained in:
Stephen Finucane 2017-12-22 18:50:49 +00:00
parent 9348c4bea1
commit c33ecd1f8f
2 changed files with 5 additions and 3 deletions

View File

@ -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])

View File

@ -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:]))