:py:mod:`pytest_flakefighters.flakefighters.abstract_flakefighter` ================================================================== .. py:module:: pytest_flakefighters.flakefighters.abstract_flakefighter .. autoapi-nested-parse:: This module implements the FlakeFighter abstract class to be extended by concrete flakefighter classes. Each of these is a microservice which takes a failed test and classifies that failure as either genuine or flaky. This classification can be configured to either run "live" after each test, or as a postprocessing step on the entire test suite after it completes. If running live, detectors are run at the end of pytest_runtest_makereport. If running as a postprocessing step, detectors are run at the start of pytest_sessionfinish. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pytest_flakefighters.flakefighters.abstract_flakefighter.FlakeFighter .. py:class:: FlakeFighter(run_live: bool) Bases: :py:obj:`abc.ABC` Abstract base class for a FlakeFighter :ivar run_live: Run detection "live" after each test. Otherwise run as a postprocessing step after the test suite. .. py:method:: from_config(config: dict) :classmethod: :abstractmethod: Factory method to create a new instance from a pytest configuration. .. py:method:: flaky_test_live(execution: pytest_flakefighters.database_management.TestExecution) :abstractmethod: Detect whether a given test execution is flaky and append the result to its `flakefighter_results` attribute. :param execution: The test execution to classify. .. py:method:: flaky_tests_post(run: pytest_flakefighters.database_management.Run) :abstractmethod: Go through each test in the test suite and append the result to its `flakefighter_results` attribute. :param run: Run object representing the pytest run, with tests accessible through run.tests. .. py:method:: params() -> dict :abstractmethod: Convert the key parameters into a dictionary so that the object can be replicated. :return A dictionary of the parameters used to create the object.