Coverage for tests / conftest.py: 90%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-30 08:37 +0000

1"""Pytest configuration file.""" 

2 

3from __future__ import annotations 

4 

5from pathlib import Path 

6 

7import pytest 

8 

9pytest_plugins = ["sphinx.testing.fixtures"] 

10 

11# Exclude 'roots' dirs for pytest test collector 

12collect_ignore: list[str] = ["roots"] 

13 

14 

15def pytest_configure(config: pytest.Config) -> None: 

16 """Add configurations for pytest.""" 

17 config.addinivalue_line("markers", "sphinx(builder, testroot='name'): Run sphinx on a site") 

18 

19 

20@pytest.fixture(scope="session") 

21def rootdir() -> Path: 

22 """Directory containing Sphinx projects for testing.""" 

23 return Path(__file__).parent.absolute() / "roots"