:py:mod:`pytest_flakefighters.rerun_strategies` =============================================== .. py:module:: pytest_flakefighters.rerun_strategies .. autoapi-nested-parse:: This module implements the various supported test rerun strategies. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pytest_flakefighters.rerun_strategies.RerunStrategy pytest_flakefighters.rerun_strategies.All pytest_flakefighters.rerun_strategies.FlakyFailure pytest_flakefighters.rerun_strategies.PreviouslyFlaky .. py:class:: RerunStrategy(max_reruns: int) Bases: :py:obj:`abc.ABC` Abstract base class for test rerun strategies. .. py:method:: rerun(report: pytest.TestReport) -> bool :abstractmethod: Decide whether to rerun a test case. :return: Boolean true to rerun, False otherwise. .. py:method:: help() -> str :classmethod: :abstractmethod: Return the help string for config options. .. py:class:: All(max_reruns: int) Bases: :py:obj:`RerunStrategy` Rerun all tests, regardless of outcome. .. py:method:: rerun(report: pytest.TestReport) -> bool Trivially rerun all tests, regardless of outcome. :return: Boolean true to rerun, False otherwise. .. py:method:: help() :classmethod: Return the help string for config options. .. py:class:: FlakyFailure(max_reruns: int) Bases: :py:obj:`RerunStrategy` Strategy to rerun failed tests marked as flaky. .. py:method:: rerun(report: pytest.TestReport) -> bool :return: Boolean true if a test fails and has been marked as flaky by live FlakeFighters. .. py:method:: help() :classmethod: Return the help string for config options. .. py:class:: PreviouslyFlaky(reruns: int, database: pytest_flakefighters.database_management.Database) Bases: :py:obj:`FlakyFailure` Rerun failed tests marked as flaky and tests previously marked as flaky. .. py:method:: rerun(report: pytest.TestReport) -> bool :return: 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. .. py:method:: help() :classmethod: Return the help string for config options.