DESCRIPTION.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. pytest-forked: run each test in a forked subprocess
  2. ====================================================
  3. .. warning::
  4. this is a extraction of the xdist --forked module,
  5. future maintenance beyond the bare minimum is not plannend until a new maintainer is found
  6. * ``--forked``: (not available on Windows) run each test in a forked
  7. subprocess to survive ``SEGFAULTS`` or otherwise dying processes
  8. Installation
  9. -----------------------
  10. Install the plugin with::
  11. pip install pytest-forked
  12. or use the package in develope/in-place mode with
  13. a checkout of the `pytest-forked repository`_ ::
  14. pip install -e .
  15. Usage examples
  16. ---------------------
  17. If you have tests involving C or C++ libraries you might have to deal
  18. with tests crashing the process. For this case you may use the boxing
  19. options::
  20. py.test --forked
  21. which will run each test in a subprocess and will report if a test
  22. crashed the process. You can also combine this option with
  23. running multiple processes via pytest-xdist to speed up the test run
  24. and use your CPU cores::
  25. py.test -n3 --forked
  26. this would run 3 testing subprocesses in parallel which each
  27. create new forked subprocesses for each test.
  28. .. _`pytest-forked repository`: https://github.com/pytest-dev/pytest-forked