Skip to content

v1.17.24 - Relative Import Fix

Choose a tag to compare

@Tefx Tefx released this 01 Feb 08:51
· 1365 commits to Main since this release

Bug Fixes

BUG-57: Property tests now work with relative imports

Previously, property tests (Hypothesis) would fail with "Could not import module" for any Python file using relative imports like from .helper import foo.

Root causes fixed:

  1. Core file detection used hardcoded "core" in path instead of reading core_paths from config
  2. Module import didn't set up proper package context for relative imports

Before:

{
  "property_tests": {
    "errors": ["Could not import module: /path/to/my_package/main.py"]
  }
}

After:

{
  "property_tests": {
    "status": "passed",
    "functions_tested": 2
  }
}

Config now works correctly:

[tool.invar.guard]
core_paths = ["my_package"]  # Now respected by CrossHair and property tests

Full Changelog

v1.17.23...v1.17.24