Skip to content

Commit ad9cf4e

Browse files
committed
Ignore giac module files in pytest collection to prevent import errors
1 parent d8a0312 commit ad9cf4e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def _find(
122122
if exception.name in (
123123
"valgrind",
124124
"sage.libs.coxeter3.coxeter",
125-
"sage.libs.giac.giac",
126125
):
127126
pytest.skip(
128127
f"unable to import module {self.path} due to missing feature {exception.name}"
@@ -216,6 +215,10 @@ def pytest_collect_file(
216215
# TODO: Fix these (import fails with "RuntimeError: dictionary changed size during iteration")
217216
return IgnoreCollector.from_parent(parent)
218217

218+
if file_path.parent.name == "giac" and file_path.parent.parent.name == "libs":
219+
# These files import the Cython extension sage.libs.giac.giac at module level
220+
return IgnoreCollector.from_parent(parent)
221+
219222
if (
220223
file_path.name in ("forker.py", "reporting.py")
221224
) and file_path.parent.name == "doctest":

0 commit comments

Comments
 (0)