Skip to content

Commit 8f2cd1b

Browse files
committed
ci: fix Windows collection and the console job's missing deps
pytest's --doctest-modules imported scripts/render_demos.py during collection, which fails on Windows at the module-scope fcntl/pty/ termios imports. Exclude scripts/ and tools/ from collection: neither contains doctests, and tests/test_readme_demos.py imports the renderer explicitly behind its own Windows skip guard. The docs console job installs only the docs-tests extra, but the shared tests/conftest.py imports freezegun and the workflow passes --no-cov: add freezegun and pytest-cov to the extra.
1 parent 81eed97 commit 8f2cd1b

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ tests = [
139139
# test run (tests/console is excluded from pytest.ini's python_files, and
140140
# `tests[]` above -- what `dev` pulls in -- deliberately omits this group).
141141
docs-tests = [
142+
# freezegun and pytest-cov are not used by tests/console itself, but
143+
# the shared tests/conftest.py imports freezegun at module scope and
144+
# the workflow passes --no-cov, so both must be importable.
145+
'freezegun>=0.3.11',
142146
'playwright>=1.48.0',
147+
'pytest-cov>=2.6.1',
143148
'pytest>=4.6.9',
144149
]
145150

pytest.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ addopts =
1818
--doctest-modules
1919
--ignore=tests/console
2020

21+
# scripts and tools are excluded because `--doctest-modules` imports
22+
# every module it collects: scripts/render_demos.py imports fcntl/pty/
23+
# termios at module scope, which does not exist on Windows (the module
24+
# has no doctests, so nothing is lost). tests/test_readme_demos.py
25+
# imports it explicitly behind its own Windows skip guard.
2126
norecursedirs =
2227
.*
2328
_*
@@ -26,7 +31,9 @@ norecursedirs =
2631
dist
2732
docs
2833
progressbar/terminal/os_specific
34+
scripts
2935
tmp*
36+
tools
3037

3138
filterwarnings =
3239
ignore::DeprecationWarning

0 commit comments

Comments
 (0)