FIX: Skip source-contract tests for isolated wheel runs - #749
Conversation
Keep the Windows DLL hardening guard active in source checkouts while skipping it when release validation intentionally installs a wheel with no source tree. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.cpp: 58.9%
mssql_python.pybind.ddbc_bindings.h: 61.5%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 75.6%
mssql_python.__init__.py: 77.6%
mssql_python.row.py: 77.6%
mssql_python.pybind.connection.connection_pool.cpp: 81.6%
mssql_python.pybind.connection.connection.cpp: 84.4%
mssql_python.logging.py: 85.5%
mssql_python.connection.py: 85.9%🔗 Quick Links
|
There was a problem hiding this comment.
🟢 Approval recommended
The change is a narrowly-scoped, correct skip guard that prevents expected failures in isolated wheel runs while keeping the assertions active in normal source checkouts.
Pull request overview
This PR updates the Windows DLL source-contract regression tests to be automatically skipped when the test environment is an isolated wheel run that does not include the repository source tree (specifically the mssql_python/pybind/ sources). This preserves the intended “source-contract” hardening assertions when running tests from a normal source checkout, while preventing false failures in release validation scenarios that intentionally lack source files.
Changes:
- Add a module-level
pytestmark = pytest.mark.skipif(...)guard to skip the entire test module whenmssql_python/pybind/is not present. - Refactor the loader source path construction by introducing
_PYBIND_DIRand deriving_LOADER_SRCfrom it.
File summaries
| File | Description |
|---|---|
| tests/test_026_windows_dll_search.py | Skips source-contract loader hardening tests when running without a source checkout (isolated wheel scenario). |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Work Item / Issue Reference
Summary
Skip the Windows DLL source-contract tests when release validation intentionally runs from an isolated wheel without the source tree. Keep the loader presence and hardening assertions active in normal source checkouts.