Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Aug 7, 2023
1 parent 47b3e0f commit f461ed2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
if: "!endsWith(matrix.python, '-dev')"
with:
python-version: ${{ matrix.python }}
- name: Set up Python ${{ matrix.python }} (deadsnakes)
uses: deadsnakes/action@v2.1.1
if: "endsWith(matrix.python, '-dev')"
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pytest
python -m pip install .[test]
python -m pip install "Sphinx @ git+https://github.com/sphinx-doc/sphinx"
- name: Test with pytest
Expand Down
5 changes: 1 addition & 4 deletions sphinxcontrib/qthelp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,14 @@ def build_keywords(self, title: str, refs: List[Any], subitems: Any) -> List[str
return keywords

def get_project_files(self, outdir: str) -> List[str]:
if not outdir.endswith(os.sep):
outdir += os.sep
olen = len(outdir)
project_files = []
staticdir = path.join(outdir, '_static')
imagesdir = path.join(outdir, self.imagedir)
for root, dirs, files in os.walk(outdir):
resourcedir = root.startswith((staticdir, imagesdir))
for fn in sorted(files):
if (resourcedir and not fn.endswith('.js')) or fn.endswith('.html'):
filename = path.join(root, fn)[olen:]
filename = path.relpath(path.join(root, fn), outdir)
project_files.append(canon_path(filename))

return project_files
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
:license: BSD, see LICENSE for details.
"""

import pytest
from pathlib import Path

from sphinx.testing.path import path
import pytest

pytest_plugins = 'sphinx.testing.fixtures'


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

0 comments on commit f461ed2

Please sign in to comment.