Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update conftest.py #2528

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 7 additions & 8 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest >= 6
pytest >= 7

# documentation
Pygments == 2.15.1
Expand Down