File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,7 @@ issues](https://github.com/data-apis/array-api-tests/issues/) to us.
136
136
By default, tests for the optional Array API extensions such as
137
137
[ ` linalg ` ] ( https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html )
138
138
will be skipped if not present in the specified array module. You can purposely
139
- skip testing extension(s) via the ` --disable-extension ` option, and likewise
140
- purposely test them via the ` --enable-extension ` option.
139
+ skip testing extension(s) via the ` --disable-extension ` option.
141
140
142
141
The tests make heavy use
143
142
[ Hypothesis] ( https://hypothesis.readthedocs.io/en/latest/ ) . You can configure
Original file line number Diff line number Diff line change @@ -27,14 +27,7 @@ def pytest_addoption(parser):
27
27
action = "store_true" ,
28
28
help = "disable the Hypothesis deadline" ,
29
29
)
30
- # enable/disable extensions
31
- parser .addoption (
32
- "--enable-extension" ,
33
- metavar = "ext" ,
34
- nargs = "+" ,
35
- default = [],
36
- help = "enable testing for Array API extension(s)" ,
37
- )
30
+ # disable extensions
38
31
parser .addoption (
39
32
"--disable-extension" ,
40
33
metavar = "ext" ,
@@ -82,21 +75,17 @@ def xp_has_ext(ext: str) -> bool:
82
75
83
76
84
77
def pytest_collection_modifyitems (config , items ):
85
- enabled_exts = config .getoption ("--enable-extension" )
86
78
disabled_exts = config .getoption ("--disable-extension" )
87
- for ext in enabled_exts :
88
- if ext in disabled_exts :
89
- raise ValueError (f"{ ext = } both enabled and disabled" )
90
79
for item in items :
91
- # enable/ disable extensions
80
+ # disable extensions
92
81
try :
93
82
ext_mark = next (m for m in item .iter_markers () if m .name == "xp_extension" )
94
83
ext = ext_mark .args [0 ]
95
84
if ext in disabled_exts :
96
85
item .add_marker (
97
86
mark .skip (reason = f"{ ext } disabled in --disable-extensions" )
98
87
)
99
- elif ext not in enabled_exts and not xp_has_ext (ext ):
88
+ elif not xp_has_ext (ext ):
100
89
item .add_marker (mark .skip (reason = f"{ ext } not found in array module" ))
101
90
except StopIteration :
102
91
pass
You can’t perform that action at this time.
0 commit comments