Skip to content

Commit

Permalink
Add note that py3.9 required to run tests to avoid:
Browse files Browse the repository at this point in the history
`ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process`
  • Loading branch information
MusicalNinjaDad committed May 23, 2024
1 parent 30f8d4e commit fff935c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions guide/src/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ fn test_one_plus_one_wrapped() {
`#[pyo3test]` takes care of wrapping the whole test case in `Python::with_gil(|py| {...})` and making
`addone` available in Rust.

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

Expand Down

0 comments on commit fff935c

Please sign in to comment.