Check if coverage collection is active in this process.
()
| 50 | |
| 51 | |
| 52 | def _coverage_active() -> bool: |
| 53 | """Check if coverage collection is active in this process.""" |
| 54 | try: |
| 55 | from coverage import Coverage |
| 56 | |
| 57 | c = Coverage.current() |
| 58 | if c is not None: |
| 59 | return True |
| 60 | except ImportError: |
| 61 | pass |
| 62 | return "COV_CORE_DATAFILE" in os.environ |
| 63 | |
| 64 | |
| 65 | def _base_env() -> dict[str, str]: |
no outgoing calls
no test coverage detected