Skip to content

Commit cc1fe6d

Browse files
authored
Merge branch 'main' into chore/benchmarks
2 parents 6a33dc3 + 20670e6 commit cc1fe6d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

changes/3605.misc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug in the test suite that prevented stand-alone example scripts from being tested.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ test = [
7575
"coverage>=7.10",
7676
# Pin possibly due to https://github.com/pytest-dev/pytest-cov/issues/693
7777
"pytest<8.4",
78-
"pytest-asyncio",
78+
"pytest-asyncio<1.2.0",
7979
"pytest-cov",
8080
"pytest-accept",
8181
"rich",

tests/test_examples.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from packaging.requirements import Requirement
1212

1313
examples_dir = "examples"
14-
script_paths = Path(examples_dir).glob("*.py")
14+
script_paths = tuple(Path(examples_dir).rglob("*.py"))
1515

1616
PEP_723_REGEX: Final = r"(?m)^# /// (?P<type>[a-zA-Z0-9-]+)$\s(?P<content>(^#(| .*)$\s)+)^# ///$"
1717

@@ -62,6 +62,13 @@ def resave_script(source_path: Path, dest_path: Path) -> None:
6262
dest_path.write_text(dest_text)
6363

6464

65+
def test_script_paths() -> None:
66+
"""
67+
Test that our test fixture is working properly and collecting script paths.
68+
"""
69+
assert len(script_paths) > 0
70+
71+
6572
@pytest.mark.skipif(
6673
sys.platform in ("win32",), reason="This test fails due for unknown reasons on Windows in CI."
6774
)

0 commit comments

Comments
 (0)