sphinx/tests/conftest.py
Stephen Finucane c33ecd1f8f 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>
2017-12-29 13:02:07 +00:00

34 lines
758 B
Python

# -*- coding: utf-8 -*-
"""
pytest config for sphinx/tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
import pytest
from sphinx.testing.path import path
pytest_plugins = 'sphinx.testing.fixtures'
# Exclude 'roots' dirs for pytest test collector
collect_ignore = ['roots']
# Disable Python version-specific
if sys.version_info < (3, 5):
collect_ignore += ['py35']
@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])