coveragerc file ignores classes with similar names

23 Views Asked by At

I'm running a coverage report in python and i created a .coveragerc file. I have two classes for example:

class LinearRegression
class LinearRegressionMLE

when i instruct the coverage report to ignore LinearRegression, it ignores LinearRegressionMLE as well. Is there anyway i can instruct it to ignore only LinearRegression while keeping LinearRegressionMLE?

my .coveragerc file:

# .coveragerc to control coverage
[report]
skip_empty = true
omit = 
    __init__.py

exclude_also =
    def __repr__
    @(abc\.)?abstractmethod
    RegressionDiagnostics
    LinearRegression

[html]
directory = tests/coverage_report_html

Thanks

1

There are 1 best solutions below

0
turtle_in_mind On

ok, i figured it out.
\bLinearRegression\b for exact match