:py:mod:`pytest_flakefighters.function_coverage` ================================================ .. py:module:: pytest_flakefighters.function_coverage .. autoapi-nested-parse:: This module implements the Profiler class to help measure function-level coverage. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pytest_flakefighters.function_coverage.Profiler .. py:class:: Profiler Provides functionality to measure function-level coverage of a pytest test suite. :ivar coverage_data: The (potentially) covered lines for each module. :ivar function_defs: The lines that define a given function in a given module, accessed as `function_defs[module][function]`. .. py:method:: update_function_defs(module: str) Extract the start and end lines for defined functions in the given module and add them to `function_defs`. :param module: The filepath of the module to process. .. py:method:: start() Start measuring coverage. .. py:method:: stop() Stop measuring coverage. .. py:method:: switch_context(context: str) Set the context name of the coverage measurement. :param context: The context name to set. .. py:method:: get_data() -> coverage.CoverageData Return coverage data.