Skip to content

Commit d400791

Browse files
committed
Use pathlib in tests
1 parent 3f99ead commit d400791

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/conftest.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1+
from pathlib import Path
2+
13
import pytest
4+
import sphinx
25
from bs4 import BeautifulSoup
3-
from sphinx.testing.path import path
4-
5-
from sphinx.application import Sphinx
6-
76

8-
pytest_plugins = "sphinx.testing.fixtures"
7+
pytest_plugins = ["sphinx.testing.fixtures"]
98

109

1110
@pytest.fixture(scope="session")
1211
def rootdir():
13-
return path(__file__).parent.abspath() / "roots"
12+
if sphinx.version_info[:2] >= (7, 0):
13+
return Path(__file__).parent.resolve() / "roots"
14+
else:
15+
from sphinx.testing.path import path
16+
17+
return path(__file__).parent.abspath() / "roots"
1418

1519

1620
@pytest.fixture()
1721
def content(app):
18-
app.build()
22+
app.build(force_all=True)
1923
yield app
2024

2125

0 commit comments

Comments
 (0)