A Pytest extension for running the pytest session inside a sub interpreter. This extension is mainly targeted for Python extension library maintainers that want to verify their existing test suite works inside a sub interpreter.
Requirements:
- Python 3.13.0-alpha.2 or above
- Pytest 7 or above
pip install pytest-subinterpreter
The extension arguments are:
--interpreter-per
Defaults tosession
(also the only option at the moment).
$ pytest tests/test_simple.py
============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.13.0a1+, pytest-7.4.3, pluggy-1.3.0
rootdir: /Users/anthonyshaw/projects/pytest-subinterpreter
plugins: subinterpreter-0.0.0
collected 1 item
tests/test_simple.py . [100%]
=============================================================================== 1 passed in 0.02s ================================================================================