PY

PyPy Testing

Testing patterns for PyPy compatibility

Details

Language / Topic
pypyPyPy
Category
Testing

Rules

balanced
- Use `pytest` for testing — it works well with PyPy.
- Test C extension compatibility before adding dependencies — check `pypy.org/compat`.
- Run the same pytest test suite as CPython — PyPy is compatible with most pytest plugins. Use `pypy -m pytest` to run.
- Run your full test suite on PyPy before deploying — some CPython-specific behaviors may differ.
- Profile with `vmprof` instead of `cProfile` — it's designed for PyPy's JIT.