Skip to content

Commit 4ee23f0

Browse files
committed
fix test
1 parent a44ca41 commit 4ee23f0

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ jobs:
6969
pip install -r requirements-dev.txt
7070
7171
- name: Build and install with C extension
72-
run: pip install -e . --no-build-isolation
72+
run: |
73+
python setup.py build_ext --inplace
74+
pip install -e . --no-build-isolation
7375
7476
- name: Run test suite (no slow/perf tests)
7577
run: |

tests/test_memory_leaks.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@
3434
import numpy as np
3535
import pytest
3636

37+
try:
38+
import metbit._native_backend # noqa: F401
39+
_NATIVE_AVAILABLE = True
40+
except ImportError:
41+
_NATIVE_AVAILABLE = False
42+
43+
_skip_no_native = pytest.mark.skipif(
44+
not _NATIVE_AVAILABLE,
45+
reason="metbit._native_backend C extension not built",
46+
)
47+
3748
# ---------------------------------------------------------------------------
3849
# Helpers
3950
# ---------------------------------------------------------------------------
@@ -79,6 +90,7 @@ def _growth_per_call(fn: Callable, reps: int = 300) -> float:
7990
# Reference count sanity (pure-Python, fast)
8091
# ---------------------------------------------------------------------------
8192

93+
@_skip_no_native
8294
class TestReferenceCount:
8395
"""Verify C extension outputs are collectable after release.
8496

0 commit comments

Comments
 (0)