Skip to content

Commit a4df720

Browse files
committed
add new test for patching
1 parent 77ef1a5 commit a4df720

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mkl_umath/tests/test_basic.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import pytest
2727
import numpy as np
2828
import mkl_umath._ufuncs as mu
29+
import mkl_umath._patch as mp
2930

3031
np.random.seed(42)
3132

@@ -82,6 +83,10 @@ def test_umath(case):
8283

8384
assert np.allclose(mkl_res, np_res), f"Results for '{umath}': mkl_res: {mkl_res}, np_res: {np_res}"
8485

85-
def test_cases_count():
86-
print("Test cases count:", len(test_cases))
87-
assert len(test_cases) > 0, "No test cases found"
86+
def test_patch():
87+
assert not mp.is_patched()
88+
mp.use_in_numpy() # Enable mkl_umath in Numpy
89+
assert mp.is_patched()
90+
91+
mp.restore() # Disable mkl_umath in Numpy
92+
assert not mp.is_patched()

0 commit comments

Comments
 (0)