{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"}],"enrichment":{"capability":"Distributes pytest test execution across multiple machines or CI workers by sharding individual test cases based on a hash of their names, enabling parallel test runs without requiring shared state.","skillfed_tags":["ci-parallelization","test-distribution"],"use_cases":["Split a large test suite across multiple CircleCI workers using CIRCLE_NODE_INDEX and CIRCLE_NODE_TOTAL environment variables.","Parallelize test execution on Travis CI by distributing test cases across multiple build jobs.","Reduce total CI build time by running disjoint test shards on separate machines without test interdependencies.","Enable fine-grained parallelism even when all tests live in a single file or parameterized test method."],"what_it_does":"pytest-shard is a pytest plugin that divides your test suite across multiple CI workers or machines by hashing individual test names and assigning each test to a shard. It works at the finest granularity\u2014individual test cases\u2014so even a single parameterized test or file can be split across workers. You run pytest with two flags: --shard-id (which worker this is) and --num-shards (total number of workers), and the plugin automatically routes each test to its assigned shard.\n\nThe package is designed for continuous integration pipelines that support parallel jobs, such as CircleCI or Travis CI. It does not balance based on test runtime\u2014all shards receive roughly equal numbers of tests\u2014and is meant to complement tools like pytest-xdist, which parallelizes across CPU cores on a single machine. The package is no longer maintained; its last release was in December 2020.","worth_installing":"Yes, if you are running pytest on a CI platform that supports parallel jobs and your test suite is stable. The plugin is simple and has no known vulnerabilities. However, do not adopt it for new projects: the package is abandoned and will not receive updates for future pytest or Python versions. Consider it only if you have an existing CI setup that already uses it or if you can commit to maintaining a fork."},"id":"pytest-shard","links":{"html":"https://skillfed.io/packages/pytest-shard","md":"https://skillfed.io/packages/pytest-shard.md","pypi":"https://pypi.org/project/pytest-shard/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2020-12-11","license_spdx":null,"license_treatment":"permissive","name":"pytest-shard","python_support":"supports_current","summary":null},"popularity":{"monthly_downloads":1797137,"position":3548,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.1.2"}
