MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_show_full_message

Function test_show_full_message

tests/unit/_statistics/test_error_tracker.py:90–101  ·  view source on GitHub ↗

Test error message settings with both options of `show_full_message`.

(*, show_full_message: bool, expected_message: str)

Source from the content-addressed store, hash-verified

88 ],
89)
90async def test_show_full_message(*, show_full_message: bool, expected_message: str) -> None:
91 """Test error message settings with both options of `show_full_message`."""
92 error_tracker = ErrorTracker(
93 show_error_name=False, show_file_and_line_number=False, show_full_message=show_full_message
94 )
95
96 try:
97 raise RuntimeError('Error line 1\n Error line 2') # Errors raised on the same line
98 except Exception as e:
99 await error_tracker.add(e)
100
101 assert error_tracker.get_most_common_errors()[0][0] == expected_message
102
103
104async def test_error_tracker_with_errors_chain() -> None:

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
ErrorTrackerClass · 0.90

Tested by

no test coverage detected