Testing¶
Running tests¶
# All owned tests
uv run pytest tests/ --ignore=tests/upstream
# Upstream GeoPandas contract tests
uv run pytest tests/upstream/
# GPU-only tests
uv run pytest tests/ --run-gpu
Test categories¶
Category |
Location |
Purpose |
|---|---|---|
Owned tests |
|
vibeSpatial-specific behavior |
Upstream contract |
|
GeoPandas API compatibility |
GPU tests |
|
Require CUDA runtime |
CPU fallback |
|
Verify fallback behavior |
Shapely oracle pattern¶
New kernel tests should compare GPU output against a Shapely reference:
def test_my_kernel(dispatch_mode):
input_geoms = [Point(0, 0), Point(1, 1)]
# GPU/CPU result
result = my_kernel(input_geoms, dispatch_mode=dispatch_mode)
# Shapely reference
expected = [shapely.my_op(g) for g in input_geoms]
assert_matches_shapely(result, expected)
Strict native mode¶
Run tests with VIBESPATIAL_STRICT_NATIVE=1 to verify no CPU fallbacks
occur. Any fallback raises immediately:
VIBESPATIAL_STRICT_NATIVE=1 uv run pytest tests/upstream/