Skip to content

Commit 85f929f

Browse files
committed
docs
1 parent 4244965 commit 85f929f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ You need to specify the array library to test. It can be specified via the
3636
$ export ARRAY_API_TESTS_MODULE=array_api_strict
3737
```
3838

39+
To specify a runtime-defined module, define `xp` using the `exec('...')` syntax:
40+
41+
```bash
42+
$ export ARRAY_API_TESTS_MODUle=exec('import pint_array, numpy; xp = pint_array.pint_namespace(numpy)')
43+
```
44+
3945
Alternately, import/define the `xp` variable in `array_api_tests/__init__.py`.
4046

4147
### Specifying the API version

array_api_tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# you want to test, e.g. `import array_api_strict as xp`.
1515
if "ARRAY_API_TESTS_MODULE" in os.environ:
1616
env_var = os.environ["ARRAY_API_TESTS_MODULE"]
17-
if env_var.startswith("exec(") and env_var.endswith(")"):
17+
if env_var.startswith("exec('") and env_var.endswith("')"):
1818
script = env_var[6:][:-2]
1919
namespace = {}
2020
exec(script, namespace)

0 commit comments

Comments
 (0)