{"library":"pytest-parallel","title":"pytest-parallel","description":"pytest-parallel is a pytest plugin that enables parallel and concurrent testing by utilizing both multiprocessing (workers) and multithreading (tests per worker). It is designed for specific use cases, such as Selenium tests, where tests can be thread-safe, benefit from non-blocking I/O, and manage minimal state in the Python environment. It is not intended as a direct replacement for pytest-xdist, which focuses solely on process-based parallelism for general test distribution. The current version is 0.1.1. The project appears to be unmaintained.","language":"python","status":"abandoned","last_verified":"Sun Apr 12","install":{"commands":["pip install pytest-parallel"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import time\nimport pytest\n\n# test_example.py\n\ndef test_fast_operation_1():\n    time.sleep(0.01)\n    assert True\n\ndef test_fast_operation_2():\n    time.sleep(0.01)\n    assert True\n\ndef test_fast_operation_3():\n    time.sleep(0.01)\n    assert True\n\ndef test_slow_operation_1():\n    time.sleep(0.1)\n    assert True\n\ndef test_slow_operation_2():\n    time.sleep(0.1)\n    assert True\n\n# Run with: pytest --workers 2 --tests-per-worker 2\n# This will execute tests using 2 processes, with each process running up to 2 tests concurrently.","lang":"python","description":"Create a test file (e.g., `test_example.py`) and then execute pytest from your terminal, specifying the number of workers (processes) and tests per worker (concurrent threads). This example demonstrates how to set up simple tests for parallel and concurrent execution.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}