{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing"}],"enrichment":{"capability":"A pytest plugin that randomly shuffles test execution order and controls the random seed for each test, helping detect hidden test dependencies and ensuring reproducible randomized test data.","skillfed_tags":["test-quality","randomization","pytest-plugin"],"use_cases":["Detect inter-test pollution by running tests in random order and reproducing failures with a saved seed.","Ensure factory-generated test data remains consistent across runs while varying between tests.","Verify that tests do not depend on global state or execution order from other tests.","Reproduce flaky test failures caused by random data or test ordering by rerunning with the reported seed.","Validate test quality by exposing assumptions about test isolation and data setup."],"what_it_does":"pytest-randomly is a pytest plugin that randomizes test execution order and manages random seeds to expose hidden test dependencies and ensure reproducible test behavior. By default, it shuffles tests at the module, class, and function levels, then resets Python's global random seed before each test to a deterministic value derived from a base seed, the test ID, and an offset. This allows tests that use random data (via factory boy, Faker, NumPy, or Model Bakery) to remain repeatable while still exercising different code paths across runs.\n\nThe plugin prints the base random seed at the start of each test run, allowing developers to reproduce failures caused by test ordering or random data by passing that seed back via the `--randomly-seed` flag. It integrates with pytest-xdist for distributed testing and supports custom random generators through an entry point mechanism. Behaviors can be disabled individually with flags like `--randomly-dont-reorganize` or `--randomly-dont-reset-seed`, and the plugin can be completely disabled with `-p no:randomly`.","worth_installing":"Yes. This is a mature, actively maintained plugin (Production/Stable status, recent release 2026-04-20) with low install friction and no security vulnerabilities. It solves a real testing problem\u2014detecting hidden test dependencies\u2014that can catch subtle bugs. The MIT license imposes no restrictions. Install it if you want to improve test reliability and catch ordering-dependent failures early."},"id":"pytest-randomly","links":{"html":"https://skillfed.io/packages/pytest-randomly","md":"https://skillfed.io/packages/pytest-randomly.md","pypi":"https://pypi.org/project/pytest-randomly/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-20","license_spdx":"MIT","license_treatment":"permissive","name":"pytest-randomly","python_support":"supports_current","summary":"Pytest plugin to randomly order tests and control random.seed."},"popularity":{"monthly_downloads":10021263,"position":1491,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"4.1.0"}
