(e: ConftestImportFailure, file: TextIO)
| 150 | |
| 151 | |
| 152 | def print_conftest_import_error(e: ConftestImportFailure, file: TextIO) -> None: |
| 153 | exc_info = ExceptionInfo.from_exception(e.cause) |
| 154 | tw = TerminalWriter(file) |
| 155 | tw.line(f"ImportError while loading conftest '{e.path}'.", red=True) |
| 156 | exc_info.traceback = exc_info.traceback.filter( |
| 157 | filter_traceback_for_conftest_import_failure |
| 158 | ) |
| 159 | exc_repr = ( |
| 160 | exc_info.getrepr(style="short", chain=False) |
| 161 | if exc_info.traceback |
| 162 | else exc_info.exconly() |
| 163 | ) |
| 164 | formatted_tb = str(exc_repr) |
| 165 | for line in formatted_tb.splitlines(): |
| 166 | tw.line(line.rstrip(), red=True) |
| 167 | |
| 168 | |
| 169 | def print_usage_error(e: UsageError, file: TextIO) -> None: |
no test coverage detected
searching dependent graphs…