pytest_flakefighters.rerun_strategies

This module implements the various supported test rerun strategies.

Module Contents

Classes

RerunStrategy

Abstract base class for test rerun strategies.

All

Rerun all tests, regardless of outcome.

FlakyFailure

Strategy to rerun failed tests marked as flaky.

PreviouslyFlaky

Rerun failed tests marked as flaky and tests previously marked as flaky.

class pytest_flakefighters.rerun_strategies.RerunStrategy(max_reruns: int)

Bases: abc.ABC

Abstract base class for test rerun strategies.

abstract rerun(report: pytest.TestReport) bool

Decide whether to rerun a test case. :return: Boolean true to rerun, False otherwise.

abstract classmethod help() str

Return the help string for config options.

class pytest_flakefighters.rerun_strategies.All(max_reruns: int)

Bases: RerunStrategy

Rerun all tests, regardless of outcome.

rerun(report: pytest.TestReport) bool

Trivially rerun all tests, regardless of outcome. :return: Boolean true to rerun, False otherwise.

classmethod help()

Return the help string for config options.

class pytest_flakefighters.rerun_strategies.FlakyFailure(max_reruns: int)

Bases: RerunStrategy

Strategy to rerun failed tests marked as flaky.

rerun(report: pytest.TestReport) bool
Returns:

Boolean true if a test fails and has been marked as flaky by live FlakeFighters.

classmethod help()

Return the help string for config options.

class pytest_flakefighters.rerun_strategies.PreviouslyFlaky(reruns: int, database: pytest_flakefighters.database_management.Database)

Bases: FlakyFailure

Rerun failed tests marked as flaky and tests previously marked as flaky.

rerun(report: pytest.TestReport) bool
Returns:

Boolean true if a test is a flaky failure or has previously been marked as flaky and has the same name as the current test.

classmethod help()

Return the help string for config options.