@@ -10,6 +10,8 @@ specification that are not yet tested here.
10
10
11
11
## Running the tests
12
12
13
+ ### Setup
14
+
13
15
To run the tests, first install the testing dependencies
14
16
15
17
pip install pytest hypothesis
20
22
21
23
as well as the array libraries that you want to test.
22
24
25
+ ### Specifying the array module
26
+
23
27
To run the tests, you need to set the array library that is to be tested. There
24
28
are two ways to do this. One way is to set the ` ARRAY_API_TESTS_MODULE `
25
29
environment variable. For example
@@ -41,6 +45,29 @@ import numpy as array_module
41
45
42
46
(replacing ` numpy ` with the array module namespace to be tested).
43
47
48
+ ### Run pytest
49
+
50
+ Simply run the ` pytest ` command to run the whole test suite.
51
+
52
+ ``` bash
53
+ pytest
54
+ ```
55
+
56
+ The test suite tries to logically organise its tests so you can find specific
57
+ test cases whilst developing something in particular. So to avoid running the
58
+ rather slow complete suite, you can specify particular test cases like any other
59
+ test suite.
60
+
61
+ ``` bash
62
+ pytest array_api_tests/test_creation_functions.py::test_zeros
63
+ ```
64
+
65
+ By default, tests for the optional Array API extensions such as
66
+ [ ` linalg ` ] ( https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html )
67
+ will be skipped if not present in the specified array module. You can purposely
68
+ skip testing extension(s) via the ` --disable-extension ` option, and likewise
69
+ purposely test them via the ` --enable-extension ` option.
70
+
44
71
## Notes on Interpreting Errors
45
72
46
73
- Some tests cannot be run unless other tests pass first. This is because very
0 commit comments