Skip to content

Commit 72a2a6d

Browse files
authored
Exclude kernel tests from coverage test (#201)
Following the addition of tests on the kernels in #183, tests have been failing because of a coverage bug (see for instance https://github.com/dottxt-ai/outlines-core/actions/runs/14191118715/job/39755824707). As those tests rely on libraries that use subprocesses, it makes coverage bug with the error `DataError: Can't combine statement coverage data with branch data` I could not find a way of fixing it (setting `parallel = False` or `concurrency = []` in the settings did not work), so I propose we exclude those tests from the coverage check.
1 parent d66f68c commit 72a2a6d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_kernels.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def guide() -> Guide:
1515
return Guide(Index("\\+?[1-9][0-9]{7,14}", VOCAB))
1616

1717

18+
@pytest.mark.no_cover
1819
def test_interface_torch():
1920
from outlines_core.kernels.torch import (
2021
allocate_token_bitmask,
@@ -67,6 +68,7 @@ def test_interface_torch():
6768
fill_next_token_bitmask(None, mask_batch2)
6869

6970

71+
@pytest.mark.no_cover
7072
def test_interface_numpy():
7173
from outlines_core.kernels.numpy import (
7274
allocate_token_bitmask,
@@ -117,6 +119,7 @@ def test_interface_numpy():
117119
fill_next_token_bitmask(None, mask_batch2)
118120

119121

122+
@pytest.mark.no_cover
120123
@pytest.mark.skipif(
121124
not importlib.util.find_spec("mlx"), reason="mlx is required to test mlx kernels" # type: ignore
122125
)
@@ -173,6 +176,7 @@ def test_interface_mlx():
173176
fill_next_token_bitmask(None, mask_batch2)
174177

175178

179+
@pytest.mark.no_cover
176180
def test_torch_correctness(guide):
177181
from outlines_core.kernels.torch import _apply_token_bitmask_inplace_kernel
178182

@@ -201,6 +205,7 @@ def test_torch_correctness(guide):
201205
), f"Token {j} should be masked but was {logits[0, j].item()}."
202206

203207

208+
@pytest.mark.no_cover
204209
def test_numpy_correctness(guide):
205210
from outlines_core.kernels.numpy import _apply_token_bitmask_inplace_kernel
206211

@@ -228,6 +233,7 @@ def test_numpy_correctness(guide):
228233
), f"Token {j} should be masked was got {logits[0, j]}."
229234

230235

236+
@pytest.mark.no_cover
231237
@pytest.mark.skipif(
232238
not importlib.util.find_spec("mlx"), reason="mlx is required to test mlx kernels" # type: ignore
233239
)

0 commit comments

Comments
 (0)