We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54fa129 commit b8ea875Copy full SHA for b8ea875
mkl_random/tests/test_patch.py
@@ -24,6 +24,7 @@
24
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
26
import numpy as np
27
+import pytest
28
29
import mkl_random
30
import mkl_random.interfaces.numpy_random as _nrand
@@ -103,3 +104,10 @@ def test_patch_reentrant():
103
104
finally:
105
while mkl_random.is_patched():
106
mkl_random.restore_numpy_random()
107
+
108
109
+def test_patch_warning():
110
+ if mkl_random.is_patched():
111
+ pytest.skip("This test should not be run with a pre-patched NumPy.")
112
+ with pytest.warns(RuntimeWarning, match="restore_numpy_random*"):
113
+ mkl_random.restore_numpy_random()
0 commit comments