2
2
import warnings
3
3
from os import getenv
4
4
from functools import reduce
5
+ import packaging .version as pv
5
6
import numpy as np
6
7
from operator import mul
7
8
from hypothesis import given
@@ -44,9 +45,12 @@ class TestHypothesisArraysApis(ExtTestCase):
44
45
45
46
@classmethod
46
47
def setUpClass (cls ):
47
- with warnings .catch_warnings ():
48
- warnings .simplefilter ("ignore" )
49
- from numpy import array_api as xp
48
+ try :
49
+ import array_api_strict as xp
50
+ except ImportError :
51
+ with warnings .catch_warnings ():
52
+ warnings .simplefilter ("ignore" )
53
+ from numpy import array_api as xp
50
54
51
55
api_version = getenv (
52
56
"ARRAY_API_TESTS_VERSION" ,
@@ -63,6 +67,9 @@ def test_strategies(self):
63
67
self .assertNotEmpty (self .xps )
64
68
self .assertNotEmpty (self .onxps )
65
69
70
+ @unittest .skipIf (
71
+ pv .Version (np .__version__ ) >= pv .Version ("2.0" ), reason = "abandonned"
72
+ )
66
73
def test_scalar_strategies (self ):
67
74
dtypes = dict (
68
75
integer_dtypes = self .xps .integer_dtypes (),
@@ -139,6 +146,9 @@ def fctonx(x, kw):
139
146
fctonx ()
140
147
self .assertEqual (len (args_onxp ), len (args_np ))
141
148
149
+ @unittest .skipIf (
150
+ pv .Version (np .__version__ ) >= pv .Version ("2.0" ), reason = "abandonned"
151
+ )
142
152
def test_square_sizes_strategies (self ):
143
153
dtypes = dict (
144
154
integer_dtypes = self .xps .integer_dtypes (),
0 commit comments