|
| | __init__ (self, list[str] ignoredirs) |
| | Store normalized ignored directory roots.
|
| |
| bool | names (self, filename, str modulename) |
| | Decide by full path whether a module is ignored.
|
| |
Avoid stdlib trace's basename-only ignore cache for same-named modules.
Definition at line 20 of file python_coverage_gate.py.
◆ __init__()
| python_coverage_gate.PathAwareIgnore.__init__ |
( |
|
self, |
|
|
list[str] |
ignoredirs |
|
) |
| |
Store normalized ignored directory roots.
- Parameters
-
| [in] | ignoredirs | Directory roots to ignore. |
Definition at line 23 of file python_coverage_gate.py.
23 def __init__(self, ignoredirs: list[str]):
24 """! @brief Store normalized ignored directory roots. @param[in] ignoredirs Directory roots to ignore. """
25 self._ignoredirs = [os.path.normpath(path) for path in ignoredirs]
26
◆ names()
| bool python_coverage_gate.PathAwareIgnore.names |
( |
|
self, |
|
|
|
filename, |
|
|
str |
modulename |
|
) |
| |
Decide by full path whether a module is ignored.
- Parameters
-
| [in] | filename | Source filename reported by the tracer. |
| [in] | modulename | Source module name reported by the tracer. |
- Returns
- True when ignored.
Definition at line 27 of file python_coverage_gate.py.
27 def names(self, filename, modulename: str) -> bool:
28 """!
29 @brief Decide by full path whether a module is ignored.
30 @param[in] filename Source filename reported by the tracer.
31 @param[in] modulename Source module name reported by the tracer.
32 @return True when ignored.
33 """
34 del modulename
35 if filename is None:
36 return True
37 normalized = os.path.normpath(filename)
38 return any(normalized.startswith(root + os.sep) for root in self._ignoredirs)
39
40
◆ _ignoredirs
| python_coverage_gate.PathAwareIgnore._ignoredirs |
|
protected |
The documentation for this class was generated from the following file: