@@ -296,10 +296,10 @@ def test_event_processing_with_strict_error_flag(
296296
297297
298298@pytest .mark .parametrize (
299- 'errors,rich_log_length,expected_args ' ,
299+ 'errors,rich_log_length' ,
300300 (
301- (EventLogErrorFlags .discard , 0 , None ),
302- (EventLogErrorFlags .ignore , 1 , { 'arg0' : 12345 } ),
301+ (EventLogErrorFlags .discard , 0 ),
302+ (EventLogErrorFlags .ignore , 1 ),
303303 )
304304)
305305def test_event_processing_with_caught_errors (
@@ -308,7 +308,6 @@ def test_event_processing_with_caught_errors(
308308 indexed_event_contract ,
309309 wait_for_transaction ,
310310 errors ,
311- expected_args ,
312311 rich_log_length ):
313312
314313 emitter_fn = indexed_event_contract .functions .logTwoEvents
@@ -322,14 +321,16 @@ def test_event_processing_with_caught_errors(
322321
323322 event_instance = indexed_event_contract .events .LogSingleWithIndex ()
324323
325- rich_logs = event_instance .processReceipt (dup_txn_receipt , errors = errors )
324+ returned_logs = event_instance .processReceipt (dup_txn_receipt , errors = errors )
326325
327- assert len (rich_logs ) == rich_log_length
326+ assert len (returned_logs ) == rich_log_length
328327
329- if len (rich_logs ) >= 1 :
330- rich_log = rich_logs [0 ]
328+ if len (returned_logs ) == 0 :
329+ assert returned_logs == ()
330+ elif len (returned_logs ) == 1 :
331+ returned_log = returned_logs [0 ]
331332
332- assert rich_log [ 'blockHash' ] == dup_txn_receipt ['blockHash' ]
333- assert rich_log [ 'blockNumber' ] == dup_txn_receipt [ 'blockNumber' ]
334- assert rich_log [ 'transactionIndex' ] == dup_txn_receipt [ 'transactionIndex' ]
335- assert is_same_address ( rich_log [ 'address' ], event_contract . address )
333+ assert returned_log == dup_txn_receipt ['logs' ][ 0 ]
334+ assert is_same_address ( returned_log [ 'address' ], event_contract . address )
335+ else :
336+ raise Exception ( 'Unreachable!' )
0 commit comments