- Drop Python 3.9 support.
Remove the random state caching, which would grow without bound, leaking memory in long test runs. The caching was added to slightly speed up re-using the same (final) seed, but since the final seed is now different for each test, it has no effect.
Modify Numpy seed restriction, replacing hashing with a modulo operation. The extra work to hash is unnecessary now that we generate a final seed per test with CRC32. This change saves ~500ns per test when Numpy is installed.
Support Python 3.14.
Use a different random seed per test, based on the test ID.
This change should mean that tests exercise more random data values in a given run, and that any randomly-generated identifiers have a lower chance of collision when stored in a shared resource like a database.
PR #687. Thanks to Bryce Drennan for the suggestion in Issue #600 and initial implementation in PR #617.
Move from MD5 to CRC32 for hashing test IDs, as it’s 5x faster and we don’t need cryptographic security.
- Drop Python 3.8 support.
- Support Python 3.13.
- Support Python 3.12.
- Reset the random state for Model Bakery.
- Drop Python 3.7 support.
- Support Python 3.11.
- Drop Python 3.6 support.
Work on FIPS Python 3.9+, by declaring use of
hashlib.md5()as not used for security.Thanks to dantebben for the report in Issue #414.
Fix crash when pytest’s cacheprovider is disabled.
Thanks to Mandeep Sandhu for the report in Issue #408.
Improve group name in
pytest --help.
Fix new shuffling to work when one or more test in a class or module have the same test id.
Thanks to Nikita Sobolev for the report in Issue #378.
Rework shuffling algorithm to use hashing. This means that running a subset of tests with the same seed will now produce the same ordering as running the full set of tests. This allows narrowing down ordering-related failures.
Thanks to Tom Grainger for the suggestion in Issue #210.
Shuffle before other test collection hooks. This allows pytest’s --stepwise flag to work, among other things.
Thanks to Tom Grainger for the suggestion to try with
--stepwise. Fixes Issue #376.
- Add type hints.
- Support Python 3.10.
- Drop dependency on
backports.entry-points-selectableby depending onimportlib-metadataversion 3.6.0+.
Fix deprecation warning from importlib-metadata 3.9.0+.
Thanks to Dominic Davis-Foster for report in Issue #333.
Stop distributing tests to reduce package size. Tests are not intended to be run outside of the tox setup in the repository. Repackagers can use GitHub's tarballs per tag.
Drop Python 3.5 support.
- Support Python 3.9.
- Move license from BSD to MIT License.
- Fix numpy error
ValueError: Seed must be between 0 and 2**32 - 1when passed a seed outside of this range.
Provide a
faker_seedfixture to set the seed for tests using faker's pytest fixtures (as per its docs).Thanks to Romain Létendart for the change in PR #261.
- Fix to work when pytest-xdist is not installed or active
(
PluginValidationError: unknown hook 'pytest_configure_node').
- Add pytest-xdist support.
Previously it only worked reliably when setting
--randomly-seedexplicitly. When not provided, the default seed generated in workers could differ and collection would fail. Now when it is not provided, all xdist worker processes shared the same default seed generated in the main process.
- Update
MANIFEST.inso tests are included in the sdist tarball again.
- Converted setuptools metadata to configuration file. This meant removing the
__version__attribute from the package. If you want to inspect the installed version, useimportlib.metadata.version("pytest-randomly")(docs / backport). - Convert reading entrypoints to use
importlib.metadata. Depend onimportlib-metadataon Python < 3.8. - Update Python support to 3.5-3.8.
- Add plugins via entry points
pytest_randomly.random_seederto allow outside packages to register additional random generators to seed. This has added a dependency on theentrypointspackage.
- Update Python support to 3.5-3.7, as 3.4 has reached its end of life.
- Handle
CollectErrors andImportErrors during collection when accessingitem.module.
- Fix including tests in sdist after re-arrangement in 2.1.0.
- Add the option
--randomly-seed=lastto reuse the last used value for the seed.
- Drop Python 2 support, only Python 3.4+ is supported now.
- Fix
DeprecationWarningwith recent versions offactory_boy.
- Fix collection to not sometimes crash when encountering pytest
Items without a module.
- Fix collection to be deterministically shuffled again, regression in 1.2.0.
- Dropped Python 2.6 compatibility, as upstream dependency NumPy did.
- Reset and output the seed at the start of the test run when
--randomly-dont-reset-seedis set, to allow the reorganization of tests to be reproducible.
- Reset the random state for NumPy too.
- Add Python 2.6 compatibility
- Offset the random seed during test setup and teardown. This is to avoid the awkward situation where test setup generates a random object, then the test generates a second one, but due to the re-seeding, they end up being always the same object. Thanks @rouge8 for the report.
- First release on PyPI.