Skip to content

Commit cb143f9

Browse files
committed
Document enable/disable ext options
1 parent 30e31cc commit cb143f9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ specification that are not yet tested here.
1010

1111
## Running the tests
1212

13+
### Setup
14+
1315
To run the tests, first install the testing dependencies
1416

1517
pip install pytest hypothesis
@@ -20,6 +22,8 @@ or
2022

2123
as well as the array libraries that you want to test.
2224

25+
### Specifying the array module
26+
2327
To run the tests, you need to set the array library that is to be tested. There
2428
are two ways to do this. One way is to set the `ARRAY_API_TESTS_MODULE`
2529
environment variable. For example
@@ -41,6 +45,29 @@ import numpy as array_module
4145

4246
(replacing `numpy` with the array module namespace to be tested).
4347

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+
4471
## Notes on Interpreting Errors
4572

4673
- Some tests cannot be run unless other tests pass first. This is because very

0 commit comments

Comments
 (0)