@@ -26,7 +26,7 @@ as well as the array libraries that you want to test.
26
26
27
27
To run the tests, you need to set the array library that is to be tested. There
28
28
are two ways to do this. One way is to set the ` ARRAY_API_TESTS_MODULE `
29
- environment variable. For example
29
+ environment variable. For example you can set it when running ` pytest `
30
30
31
31
ARRAY_API_TESTS_MODULE=numpy pytest
32
32
@@ -39,34 +39,20 @@ array_module = None
39
39
40
40
to
41
41
42
- ```
42
+ ``` py
43
43
import numpy as array_module
44
44
```
45
45
46
46
(replacing ` numpy ` with the array module namespace to be tested).
47
47
48
- ### Run pytest
49
-
50
- Simply run the ` pytest ` command to run the whole test suite.
51
-
52
- ``` bash
53
- pytest
54
- ```
48
+ ### Specifying test cases
55
49
56
50
The test suite tries to logically organise its tests so you can find specific
57
51
test cases whilst developing something in particular. So to avoid running the
58
52
rather slow complete suite, you can specify particular test cases like any other
59
53
test suite.
60
54
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.
55
+ pytest array_api_tests/test_creation_functions.py::test_zeros
70
56
71
57
## Notes on Interpreting Errors
72
58
@@ -93,6 +79,12 @@ purposely test them via the `--enable-extension` option.
93
79
94
80
## Configuring Tests
95
81
82
+ By default, tests for the optional Array API extensions such as
83
+ [ ` linalg ` ] ( https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html )
84
+ will be skipped if not present in the specified array module. You can purposely
85
+ skip testing extension(s) via the ` --disable-extension ` option, and likewise
86
+ purposely test them via the ` --enable-extension ` option.
87
+
96
88
The tests make heavy use of the
97
89
[ Hypothesis] ( https://hypothesis.readthedocs.io/en/latest/ ) testing library.
98
90
Hypothesis generates random input values for the tests. You can configure how
0 commit comments