12
12
[True , False , "asphalt.exceptions" , logging .getLogger ("asphalt.exceptions" )],
13
13
ids = ["autologger" , "nologger" , "strlogger" , "loggerinstance" ],
14
14
)
15
- @pytest .mark .parametrize (
16
- "faulty_extras_provider" , [False , True ], ids = ["goodextras" , "badextras" ]
17
- )
18
- @pytest .mark .parametrize (
19
- "faulty_reporter" , [False , True ], ids = ["goodreporter" , "badreporter" ]
20
- )
15
+ @pytest .mark .parametrize ("faulty_extras_provider" , [False , True ], ids = ["goodextras" , "badextras" ])
16
+ @pytest .mark .parametrize ("faulty_reporter" , [False , True ], ids = ["goodreporter" , "badreporter" ])
21
17
@pytest .mark .asyncio
22
- async def test_report_exception (
23
- logger , faulty_extras_provider , faulty_reporter , caplog
24
- ):
18
+ async def test_report_exception (logger , faulty_extras_provider , faulty_reporter , caplog ):
25
19
reported_exception = reported_message = None
26
20
27
21
class DummyReporter (ExceptionReporter ):
@@ -59,9 +53,7 @@ def get_extras(self, ctx: Context, reporter: ExceptionReporter):
59
53
60
54
if faulty_reporter and logger :
61
55
messages = [
62
- record .message
63
- for record in caplog .records
64
- if record .name == "asphalt.exceptions"
56
+ record .message for record in caplog .records if record .name == "asphalt.exceptions"
65
57
]
66
58
assert messages [- 1 ].startswith (
67
59
"error calling exception reporter "
@@ -71,6 +63,4 @@ def get_extras(self, ctx: Context, reporter: ExceptionReporter):
71
63
72
64
def test_no_exception ():
73
65
exc = pytest .raises (Exception , report_exception , Context (), "test" )
74
- exc .match (
75
- 'missing "exception" parameter and no current exception present in sys.exc_info()'
76
- )
66
+ exc .match ('missing "exception" parameter and no current exception present in sys.exc_info()' )
0 commit comments