NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2446 most downloaded on PyPI
Adds the ability to retry flaky tests in CI environments
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 12 months
Nearly every release is documented
notes for 16 of 16 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
16 releases · first in 2022
One column per quarter.
Enabled changing the outcome name for compatibility with reporting plugins by @andrew-cleveland in https://github.com/str0zzapreti/pytest-retry/pull/4
ResourceWarning when using pytest-xdist by @francis-clairicia in https://github.com/str0zzapreti/pytest-retry/pull/39Full Changelog: https://github.com/str0zzapreti/pytest-retry/compare/1.6.3...1.7.0
ResourceWarning when using pytest-xdist by @francis-clairicia in #39Full Changelog: 1.6.3...1.7.0
use verbosity count for trace limit rather than unlimited trace depth in verbose mode @str0zzapreti in https://github.com/str0zzapreti/pytest-retry/pu
Full Changelog: https://github.com/str0zzapreti/pytest-retry/compare/1.6.2...1.6.3
Full Changelog: 1.6.2...1.6.3
fixed Item instantiation error in Pytest 8 by @str0zzapreti in https://github.com/str0zzapreti/pytest-retry/pull/35
Full Changelog: https://github.com/str0zzapreti/pytest-retry/compare/1.6.1...1.6.2
Full Changelog: 1.6.1...1.6.2
Fixed an OSError exception which could occur due to a socket port assignment conflict when running multiple instances of pytest-retry with pytest-xdis
Retry reports will now be displayed when using pytest-xdist with n > 1
Full Changelog: https://github.com/str0zzapreti/pytest-retry/compare/1.5.0...1.6.0
Full Changelog: 1.5.0...1.6.0
Global retries can now be configured using .ini files as an alternative to using command line options. This also adds pyproject.toml support for free.
Fix for issue #20: Unexpected strict xfail exception
Fixed a module directory which was causing an import error when attempting to retry tests.
Hotfix Release
Bug Fixes:
BREAKING CHANGES: Previously, any arguments not specified in a flaky mark would fall back to the default plugin values. From 1.4.0 onwards, unspecifie…
New features:
condition argument is available for the flaky mark which provides greater control over when tests are retried. Tests with a condition argument in the flaky mark will only be retried if condition is True. This can be used to, for example, configure a test to only retry when running on a specific operating system or during a specific time of day.Note: There is no matching command line parameter for condition, but the documentation has been updated to suggest an easy workaround if you need to globally add the same condition to all of your tests at once without marking each individually.
BREAKING CHANGES: Previously, any arguments not specified in a flaky mark would fall back to the default plugin values. From 1.4.0 onwards, unspecified arguments will now fall back to your global defaults if specified. To understand the difference in behavior, consider the following case:
pytest-retry defaults to a value of 0 for retry delay unless specified via the command line or a flaky mark
You run the following test file
import pytest
@pytest.mark.flaky(retries=3)
def test_unreliable_function():
# testing some unreliable function here
# assert expected function result
with the following command line arguments:
python -m pytest --retries=2, --retry-delay=5
Since the flaky mark does not specify a delay argument, prior to version 1.4.0, test_unreliable_function would be retried 3 times (flaky mark args override command line) with 0 delay between attempts. From version 1.4.0 onwards, test_unreliable_function would be retried 3 times with a 5 second delay between each attempt.
In other words, flaky marks before 1.4.0 silently ignore all of your command line options, while flaky marks from 1.4.0 onward will respect any command line options that you did not explicitly wish to override
If you have a configuration which relies on the previous behavior and want to upgrade, it should be simple to update your affected tests accordingly. This change was made according to the principle of least surprise (the new behavior appears more intuitive), but please feel free to provide feedback on this change.
Bug Fixes: Fixed a bug where 'excluded' exceptions passed to a flaky mark were not being filtered. Fixed a test which was validating this incorrect behavior by mistake.
Test retries can now be made conditional upon a list of filtered or excluded exception types. Filtered exceptions will only initiate retries if the fa
New features:
Prevented a possible durations index error if another exception occurred during the pytest_report_teststatus stage. (e.g. if using a custom teststatus
Hotfix release
Fixes:
Overhauled internal test reporting system to track outcome, attempts, and duration per test
New featues:
Unhandled exceptions during teardown cause runtest process to fail on a stash KeyError
Fixed the following bugs:
New featues:
success_key and attempt_key can be imported and used to access these values in other hooks or fixtures.Test durations are now overwritten by the most recent attempt by default. This is to provide more consistent data to time-based splitting algorithms,
Changelog:
The latest original report is now attached to the test item for easy access
Changelog:
Initial release of pytest-retry
Initial release of pytest-retry
Your coding agent can read these notes before it upgrades. Set up the MCP server →