Skip to content

Commit 31be9c9

Browse files
CI: use pytest append import mode so the installed wheel wins
In cibuildwheel the tests are run against the installed wheel, but pytest's default 'prepend' import mode inserts the project root at sys.path[0]. That shadows the installed compiled wheel with the in-tree pure-Python cassandra/ source, so 'import cassandra.row_parser' / 'cassandra.io.libevreactor' / 'cassandra.cmurmur3' all fail and every libev/cmurmur3/Cython test skips. Under CASS_DRIVER_NO_SKIP those skips became failures. Switch to --import-mode=append so site-packages (the wheel) takes precedence while the 'tests' package is still importable from the appended project root.
1 parent f3875e1 commit 31be9c9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ log_format = "%(asctime)s.%(msecs)03d %(levelname)s [%(module)s:%(lineno)s]: %(m
121121
log_level = "DEBUG"
122122
log_date_format = "%Y-%m-%d %H:%M:%S"
123123
xfail_strict = true
124-
addopts = "-rf"
124+
# Use 'append' import mode so the installed package (e.g. the compiled wheel
125+
# under cibuildwheel) takes precedence on sys.path over the in-tree ``cassandra``
126+
# source directory. With the default 'prepend' mode pytest inserts the project
127+
# root at sys.path[0], which shadows the installed wheel with the uncompiled
128+
# source tree and makes every C-extension test (libev, cmurmur3, Cython) skip.
129+
addopts = "-rf --import-mode=append"
125130
markers = [
126131
"last: mark test to run last within its module group",
127132
]

0 commit comments

Comments
 (0)