Skip to content

Commit f08da7f

Browse files
committed
Remove --ci option
And move meta tests to top-level meta_tests folder
1 parent 8bac520 commit f08da7f

32 files changed

+33
-84
lines changed

.github/workflows/numpy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
env:
2929
ARRAY_API_TESTS_MODULE: numpy.array_api
3030
run: |
31-
pytest -v -rxXfE --ci --skips-file numpy-skips.txt
31+
pytest -v -rxXfE --skips-file numpy-skips.txt array_api_tests/

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,6 @@ You can specify the API version to use when testing via the
161161
array module's `__array_api_version__` value, and if that attribute doesn't
162162
exist then we fallback to `"2021.12"`.
163163

164-
#### CI flag
165-
166-
Use the `--ci` flag to run only the primary and special cases tests. You can
167-
ignore the other test cases as they are redundant for the purposes of checking
168-
compliance.
169-
170164
#### Data-dependent shapes
171165

172166
Use the `--disable-data-dependent-shapes` flag to skip testing functions which have

array_api_tests/test_array_object.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
from . import xp as _xp
1717
from .typing import DataType, Index, Param, Scalar, ScalarType, Shape
1818

19-
pytestmark = pytest.mark.ci
20-
2119

2220
def scalar_objects(
2321
dtype: DataType, shape: Shape

array_api_tests/test_constants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from . import xp
88
from .typing import Array
99

10-
pytestmark = pytest.mark.ci
11-
1210

1311
def assert_scalar_float(name: str, c: Any):
1412
assert isinstance(c, SupportsFloat), f"{name}={c!r} does not look like a float"

array_api_tests/test_creation_functions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from itertools import count
44
from typing import Iterator, NamedTuple, Union
55

6-
import pytest
76
from hypothesis import assume, given, note
87
from hypothesis import strategies as st
98

@@ -15,8 +14,6 @@
1514
from . import xps
1615
from .typing import DataType, Scalar
1716

18-
pytestmark = pytest.mark.ci
19-
2017

2118
class frange(NamedTuple):
2219
start: float

array_api_tests/test_data_type_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from . import xp as _xp
1515
from .typing import DataType
1616

17-
pytestmark = pytest.mark.ci
18-
1917

2018
# TODO: test with complex dtypes
2119
def non_complex_dtypes():

array_api_tests/test_fft.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from . import xp
1818

1919
pytestmark = [
20-
pytest.mark.ci,
2120
pytest.mark.xp_extension("fft"),
2221
pytest.mark.min_version("2022.12"),
2322
]

array_api_tests/test_has_names.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from .stubs import (array_attributes, array_methods, category_to_funcs,
1010
extension_to_funcs, EXTENSIONS)
1111

12-
pytestmark = pytest.mark.ci
13-
1412
has_name_params = []
1513
for ext, stubs in extension_to_funcs.items():
1614
for stub in stubs:

array_api_tests/test_indexing_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from . import shape_helpers as sh
1010
from . import xps
1111

12-
pytestmark = pytest.mark.ci
13-
1412

1513
@pytest.mark.min_version("2022.12")
1614
@given(

array_api_tests/test_linalg.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
from . import _array_module as xp
4444
from ._array_module import linalg
4545

46-
pytestmark = pytest.mark.ci
47-
4846
def assert_equal(x, y, msg_extra=None):
4947
extra = '' if not msg_extra else f' ({msg_extra})'
5048
if x.dtype in dh.all_float_dtypes:

array_api_tests/test_manipulation_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from . import xps
1515
from .typing import Array, Shape
1616

17-
pytestmark = pytest.mark.ci
18-
1917
MAX_SIDE = hh.MAX_ARRAY_SIZE // 64
2018
MAX_DIMS = min(hh.MAX_ARRAY_SIZE // MAX_SIDE, 32) # NumPy only supports up to 32 dims
2119

array_api_tests/test_operators_and_elementwise_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
from . import xps
2222
from .typing import Array, DataType, Param, Scalar, ScalarType, Shape
2323

24-
pytestmark = pytest.mark.ci
25-
2624

2725
def all_integer_dtypes() -> st.SearchStrategy[DataType]:
2826
"""Returns a strategy for signed and unsigned integer dtype objects."""

array_api_tests/test_searching_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from . import shape_helpers as sh
1212
from . import xps
1313

14-
pytestmark = pytest.mark.ci
15-
1614

1715
@given(
1816
x=hh.arrays(

array_api_tests/test_set_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from . import shape_helpers as sh
1414
from . import xps
1515

16-
pytestmark = [pytest.mark.ci, pytest.mark.data_dependent_shapes]
16+
pytestmark = pytest.mark.data_dependent_shapes
1717

1818

1919
@given(hh.arrays(dtype=xps.scalar_dtypes(), shape=hh.shapes(min_side=1)))

array_api_tests/test_signatures.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ def squeeze(x, /, axis):
3333
from . import xp
3434
from .stubs import array_methods, category_to_funcs, extension_to_funcs, name_to_func
3535

36-
pytestmark = pytest.mark.ci
37-
3836
ParameterKind = Literal[
3937
Parameter.POSITIONAL_ONLY,
4038
Parameter.VAR_POSITIONAL,

array_api_tests/test_sorting_functions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import cmath
22
from typing import Set
33

4-
import pytest
54
from hypothesis import given
65
from hypothesis import strategies as st
76
from hypothesis.control import assume
@@ -14,8 +13,6 @@
1413
from . import xps
1514
from .typing import Scalar, Shape
1615

17-
pytestmark = pytest.mark.ci
18-
1916

2017
def assert_scalar_in_set(
2118
func_name: str,

array_api_tests/test_special_cases.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
from . import xp, xps
3636
from .stubs import category_to_funcs
3737

38-
pytestmark = pytest.mark.ci
39-
4038
UnaryCheck = Callable[[float], bool]
4139
BinaryCheck = Callable[[float, float], bool]
4240

array_api_tests/test_statistical_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
from ._array_module import _UndefinedStub
1616
from .typing import DataType
1717

18-
pytestmark = pytest.mark.ci
19-
2018

2119
def kwarg_dtypes(dtype: DataType) -> st.SearchStrategy[Optional[DataType]]:
2220
dtypes = [d2 for d1, d2 in dh.promotion_table if d1 == dtype]

array_api_tests/test_utility_functions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
from hypothesis import given
32
from hypothesis import strategies as st
43

@@ -9,8 +8,6 @@
98
from . import shape_helpers as sh
109
from . import xps
1110

12-
pytestmark = pytest.mark.ci
13-
1411

1512
@given(
1613
x=hh.arrays(dtype=xps.scalar_dtypes(), shape=hh.shapes(min_side=1)),

conftest.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ def pytest_addoption(parser):
5454
help="disable testing functions with output shapes dependent on input",
5555
)
5656
# CI
57-
parser.addoption(
58-
"--ci",
59-
action="store_true",
60-
help="run just the tests appropriate for CI",
61-
)
6257
parser.addoption(
6358
"--skips-file",
6459
action="store",
@@ -78,7 +73,6 @@ def pytest_configure(config):
7873
config.addinivalue_line(
7974
"markers", "data_dependent_shapes: output shapes are dependent on inputs"
8075
)
81-
config.addinivalue_line("markers", "ci: primary test")
8276
config.addinivalue_line(
8377
"markers",
8478
"min_version(api_version): run when greater or equal to api_version",
@@ -144,7 +138,6 @@ def pytest_collection_modifyitems(config, items):
144138

145139
disabled_exts = config.getoption("--disable-extension")
146140
disabled_dds = config.getoption("--disable-data-dependent-shapes")
147-
ci = config.getoption("--ci")
148141

149142
for item in items:
150143
markers = list(item.iter_markers())
@@ -178,11 +171,6 @@ def pytest_collection_modifyitems(config, items):
178171
mark.skip(reason="disabled via --disable-data-dependent-shapes")
179172
)
180173
break
181-
# skip if test not appropriate for CI
182-
if ci:
183-
ci_mark = next((m for m in markers if m.name == "ci"), None)
184-
if ci_mark is None:
185-
item.add_marker(mark.skip(reason="disabled via --ci"))
186174
# skip if test is for greater api_version
187175
ver_mark = next((m for m in markers if m.name == "min_version"), None)
188176
if ver_mark is not None:

meta_tests/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Testing the utilities used in `array_api_tests/`
File renamed without changes.

array_api_tests/meta/test_array_helpers.py renamed to meta_tests/test_array_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from .. import _array_module as xp
2-
from ..array_helpers import exactly_equal, notequal
1+
from array_api_tests import _array_module as xp
2+
from array_api_tests .array_helpers import exactly_equal, notequal
33

44
# TODO: These meta-tests currently only work with NumPy
55

array_api_tests/meta/test_broadcasting.py renamed to meta_tests/test_broadcasting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66

7-
from .. import shape_helpers as sh
7+
from array_api_tests import shape_helpers as sh
88

99

1010
@pytest.mark.parametrize(

array_api_tests/meta/test_equality_mapping.py renamed to meta_tests/test_equality_mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from ..dtype_helpers import EqualityMapping
3+
from array_api_tests .dtype_helpers import EqualityMapping
44

55

66
def test_raises_on_distinct_eq_key():

array_api_tests/meta/test_hypothesis_helpers.py renamed to meta_tests/test_hypothesis_helpers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
from hypothesis import strategies as st
77
from hypothesis.errors import Unsatisfiable
88

9-
from .. import _array_module as xp
10-
from .. import array_helpers as ah
11-
from .. import dtype_helpers as dh
12-
from .. import hypothesis_helpers as hh
13-
from .. import shape_helpers as sh
14-
from .. import xps
15-
from .._array_module import _UndefinedStub
9+
from array_api_tests import _array_module as xp
10+
from array_api_tests import array_helpers as ah
11+
from array_api_tests import dtype_helpers as dh
12+
from array_api_tests import hypothesis_helpers as hh
13+
from array_api_tests import shape_helpers as sh
14+
from array_api_tests import xps
15+
from array_api_tests ._array_module import _UndefinedStub
1616

1717
UNDEFINED_DTYPES = any(isinstance(d, _UndefinedStub) for d in dh.all_dtypes)
1818
pytestmark = [pytest.mark.skipif(UNDEFINED_DTYPES, reason="undefined dtypes")]

array_api_tests/meta/test_linalg.py renamed to meta_tests/test_linalg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from hypothesis import given
44

5-
from ..hypothesis_helpers import symmetric_matrices
6-
from .. import array_helpers as ah
7-
from .. import _array_module as xp
5+
from array_api_tests .hypothesis_helpers import symmetric_matrices
6+
from array_api_tests import array_helpers as ah
7+
from array_api_tests import _array_module as xp
88

99
@pytest.mark.xp_extension('linalg')
1010
@given(x=symmetric_matrices(finite=True))

array_api_tests/meta/test_partial_adopters.py renamed to meta_tests/test_partial_adopters.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import pytest
22
from hypothesis import given
33

4-
from .. import dtype_helpers as dh
5-
from .. import hypothesis_helpers as hh
6-
from .. import _array_module as xp
7-
from .._array_module import _UndefinedStub
4+
from array_api_tests import dtype_helpers as dh
5+
from array_api_tests import hypothesis_helpers as hh
6+
from array_api_tests import _array_module as xp
7+
from array_api_tests ._array_module import _UndefinedStub
88

99

1010
# e.g. PyTorch only supports uint8 currently

array_api_tests/meta/test_pytest_helpers.py renamed to meta_tests/test_pytest_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pytest import raises
22

3-
from .. import _array_module as xp
4-
from .. import pytest_helpers as ph
3+
from array_api_tests import _array_module as xp
4+
from array_api_tests import pytest_helpers as ph
55

66

77
def test_assert_dtype():

array_api_tests/meta/test_signatures.py renamed to meta_tests/test_signatures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from ..test_signatures import _test_inspectable_func
5+
from array_api_tests .test_signatures import _test_inspectable_func
66

77

88
def stub(foo, /, bar=None, *, baz=None):

array_api_tests/meta/test_special_cases.py renamed to meta_tests/test_special_cases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import math
22

3-
from ..test_special_cases import parse_result
3+
from array_api_tests .test_special_cases import parse_result
44

55

66
def test_parse_result():

array_api_tests/meta/test_utils.py renamed to meta_tests/test_utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
from hypothesis import given
33
from hypothesis import strategies as st
44

5-
from .. import _array_module as xp
6-
from .. import dtype_helpers as dh
7-
from .. import hypothesis_helpers as hh
8-
from .. import shape_helpers as sh
9-
from .. import xps
10-
from ..test_creation_functions import frange
11-
from ..test_manipulation_functions import roll_ndindex
12-
from ..test_operators_and_elementwise_functions import mock_int_dtype
5+
from array_api_tests import _array_module as xp
6+
from array_api_tests import dtype_helpers as dh
7+
from array_api_tests import hypothesis_helpers as hh
8+
from array_api_tests import shape_helpers as sh
9+
from array_api_tests import xps
10+
from array_api_tests .test_creation_functions import frange
11+
from array_api_tests .test_manipulation_functions import roll_ndindex
12+
from array_api_tests .test_operators_and_elementwise_functions import mock_int_dtype
1313

1414

1515
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)