File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ You need to specify the array library to test. It can be specified via the
36
36
$ export ARRAY_API_TESTS_MODULE=array_api_strict
37
37
```
38
38
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
+
39
45
Alternately, import/define the ` xp ` variable in ` array_api_tests/__init__.py ` .
40
46
41
47
### Specifying the API version
Original file line number Diff line number Diff line change 14
14
# you want to test, e.g. `import array_api_strict as xp`.
15
15
if "ARRAY_API_TESTS_MODULE" in os .environ :
16
16
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 ("' )" ):
18
18
script = env_var [6 :][:- 2 ]
19
19
namespace = {}
20
20
exec (script , namespace )
You can’t perform that action at this time.
0 commit comments