diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13619bea9..f1b2a7008 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: matrix: name-prefix: [''] os: [ubuntu-latest] - python: [3.8, 3.9, '3.10', 3.11, 3.12-dev, pypy-3.10, pyodide] + python: [3.8, 3.9, '3.10', 3.11, 3.12, pypy-3.10, pyodide] include: # To keep the overall number of runs low, we test Windows and MacOS # only on the latest CPython. diff --git a/conftest.py b/conftest.py index a88904842..815d86d89 100644 --- a/conftest.py +++ b/conftest.py @@ -1,19 +1,18 @@ -import importlib import os from pathlib import Path -import pytest +import hy, pytest -NATIVE_TESTS = os.path.join("", "tests", "native_tests", "") +NATIVE_TESTS = Path.cwd() / "tests/native_tests" # https://github.com/hylang/hy/issues/2029 os.environ.pop("HYSTARTUP", None) -def pytest_collect_file(parent, path): +def pytest_collect_file(file_path, parent): if ( - path.ext == ".hy" - and NATIVE_TESTS in path.dirname + os.sep - and path.basename != "__init__.hy" + file_path.suffix == ".hy" + and NATIVE_TESTS in file_path.parents + and file_path.name != "__init__.hy" ): - return pytest.Module.from_parent(parent, path=Path(path)) + return pytest.Module.from_parent(parent, path=file_path) diff --git a/requirements-dev.txt b/requirements-dev.txt index 05f75721e..a28ba3224 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -pytest >= 6 +pytest >= 7 # documentation Pygments == 2.15.1