pytest-func-cov

raw JSON →
0.2.3 verified Fri May 01 auth: no python

Pytest plugin for measuring function coverage, tracking which functions are called during tests. Current version 0.2.3, requires Python >=3.6. Development appears to be low-cadence with sporadic releases.

pip install pytest-func-cov
error ModuleNotFoundError: No module named 'pytest_func_cov'
cause Package not installed or installed incorrectly.
fix
Run 'pip install pytest-func-cov' to install the plugin.
error ImportError: cannot import name 'pytest_func_cov' from partially initialized module
cause Circular dependency due to wrong import order (common in versions <=0.2.1).
fix
Upgrade pytest-func-cov to 0.2.3 using 'pip install --upgrade pytest-func-cov'.
error AttributeError: module 'pytest_func_cov' has no attribute 'run'
cause Trying to use the plugin as a regular module instead of via pytest CLI.
fix
Use the plugin with pytest command-line: 'pytest --func-cov'.
deprecated The package has not been updated since 2021. Consider using pytest-cov for more comprehensive coverage.
fix Switch to pytest-cov (pip install pytest-cov) for active maintenance and broader support.
gotcha Plugin requires specific import order; not importing a package's __init__.py first may cause circular dependency errors.
fix Upgrade to 0.2.3 or ensure __init__.py is imported before other modules.
breaking In version 0.2.0, the console output format changed to align with pytest-cov. Scripts parsing coverage output may break.
fix Update any output parsing to match pytest-cov style.

Install the plugin and run pytest with the --func-cov flag to generate function coverage report.

# Install: pip install pytest-func-cov
# Then run pytest with --func-cov flag
# Example usage in a test file:
def test_example():
    assert 1 + 1 == 2

# Run: pytest --func-cov test_example.py