Skip to content

Commit fff935c

Browse files
Add note that py3.9 required to run tests to avoid:
`ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process`
1 parent 30f8d4e commit fff935c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎guide/src/testing.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ fn test_one_plus_one_wrapped() {
114114
`#[pyo3test]` takes care of wrapping the whole test case in `Python::with_gil(|py| {...})` and making
115115
`addone` available in Rust.
116116

117+
> **Note:** running multiple tests which `#[pyo3import]` the same wrapped module requires _at least python3.9_.
118+
>
119+
> This does not affect which systems you can build and release for, only the interpreter used for these tests.
120+
117121
In a non-trivial case, you will likely have Type conversions and Error handling which you wish to
118122
validate at this point.
119123

0 commit comments

Comments
 (0)