()
| 38 | |
| 39 | |
| 40 | def test_formatting_with_exception() -> None: |
| 41 | formatter = CrawleeLogFormatter() |
| 42 | try: |
| 43 | raise ValueError('This is a test exception') |
| 44 | |
| 45 | except ValueError: |
| 46 | exc_info = sys.exc_info() |
| 47 | record = get_log_record(logging.ERROR, 'Exception occurred', exc_info=exc_info) |
| 48 | formatted_message = formatter.format(record) |
| 49 | |
| 50 | assert '\x1b[90m[test]\x1b[0m \x1b[31mERROR\x1b[0m Exception occurred' in formatted_message |
| 51 | assert 'ValueError: This is a test exception' in formatted_message |
| 52 | |
| 53 | |
| 54 | def test_formatter_without_name() -> None: |
nothing calls this directly
no test coverage detected