Skip to content

Commit 34d8030

Browse files
committed
Regression tests: handle deprecation of sphinx.testing.path
1 parent 8b0c74d commit 34d8030

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests_regression/conftest.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11

22
import os
33

4-
import pytest
4+
from pathlib import Path
55

6-
from sphinx.testing.path import path
6+
import pytest
7+
import sphinx
78

89

910
from .helpers.regression import verify_output
1011

1112

13+
ROOT_DIR = Path(__file__).parent / 'sphinx'
14+
15+
1216
pytest_plugins = 'sphinx.testing.fixtures'
1317
collect_ignore = ['sphinx']
1418

1519

1620
@pytest.fixture(scope='session')
1721
def rootdir():
18-
return path(__file__).parent.abspath() / 'sphinx'
22+
if sphinx.version_info < (8, 0):
23+
from sphinx.testing.path import path
24+
return path(__file__).parent.abspath() / 'sphinx'
25+
else:
26+
return Path(__file__).parent / 'sphinx'
1927

2028

2129
@pytest.fixture(scope='function')

0 commit comments

Comments
 (0)