Skip to content

Commit d36074c

Browse files
committed
Fix test failures
1 parent 0ec774d commit d36074c

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,20 @@ jobs:
3131

3232
steps:
3333
- uses: actions/checkout@v3
34-
- name: Setup Python ${{ matrix.python }}
34+
- name: Set up Python ${{ matrix.python }}
3535
uses: actions/setup-python@v4
36+
if: "!endsWith(matrix.python, '-dev')"
37+
with:
38+
python-version: ${{ matrix.python }}
39+
- name: Set up Python ${{ matrix.python }} (deadsnakes)
40+
uses: deadsnakes/action@v2.1.1
41+
if: "endsWith(matrix.python, '-dev')"
3642
with:
3743
python-version: ${{ matrix.python }}
3844
- name: Install dependencies
3945
run: |
4046
python -m pip install --upgrade pip
41-
python -m pip install --upgrade pytest
47+
python -m pip install .[test]
4248
python -m pip install "Sphinx @ git+https://github.com/sphinx-doc/sphinx"
4349
4450
- name: Test with pytest

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
:license: BSD, see LICENSE for details.
77
"""
88

9-
import pytest
9+
from pathlib import Path
1010

11-
from sphinx.testing.path import path
11+
import pytest
1212

1313
pytest_plugins = 'sphinx.testing.fixtures'
1414

1515

1616
@pytest.fixture(scope='session')
1717
def rootdir():
18-
return path(__file__).parent.abspath() / 'roots'
18+
return Path(__file__).resolve().parent / 'roots'

tests/test_applehelp.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
:license: BSD, see LICENSE for details.
99
"""
1010

11+
from pathlib import Path
1112
import plistlib
1213

1314
import pytest
1415

15-
from sphinx.testing.path import path
16-
1716

1817
def check_structure(outdir):
1918
contentsdir = outdir / 'Contents'
@@ -40,13 +39,13 @@ def check_localization(outdir):
4039
confoverrides={'applehelp_bundle_id': 'org.sphinx-doc.Sphinx.help',
4140
'applehelp_disable_external_tools': True})
4241
def test_applehelp_output(app, status, warning):
43-
(app.srcdir / 'en.lproj').makedirs()
44-
(app.srcdir / 'en.lproj' / 'localized.txt').write_text('')
42+
(app.srcdir / 'en.lproj').mkdir(parents=True, exist_ok=True)
43+
(app.srcdir / 'en.lproj' / 'localized.txt').touch()
4544
app.builder.build_all()
4645

4746
# Have to use bundle_path, not outdir, because we alter the latter
4847
# to point to the lproj directory so that the HTML arrives in the
4948
# correct location.
50-
bundle_path = path(app.builder.bundle_path)
49+
bundle_path = Path(app.builder.bundle_path)
5150
check_structure(bundle_path)
5251
check_localization(bundle_path)

0 commit comments

Comments
 (0)