Record each pattern compilation while preserving regex behavior.
(pattern: str, flags: int = 0)
| 261 | original_compile = re.compile |
| 262 | |
| 263 | def counted_compile(pattern: str, flags: int = 0) -> re.Pattern[str]: |
| 264 | """Record each pattern compilation while preserving regex behavior.""" |
| 265 | nonlocal compile_calls |
| 266 | compile_calls += 1 |
| 267 | return original_compile(pattern, flags) |
| 268 | |
| 269 | monkeypatch.setattr("commitizen.version_increment.re.compile", counted_compile) |
| 270 |
nothing calls this directly
no outgoing calls
no test coverage detected