3232 NameNotFound ,
3333 NoABIFound ,
3434 NoABIFunctionsFound ,
35- ValidationError ,
35+ Web3ValidationError ,
3636)
3737
3838MULTIPLE_FUNCTIONS = json .loads (
@@ -317,7 +317,7 @@ def test_set_strict_byte_array(strict_arrays_contract, call, transact, args, exp
317317def test_set_strict_byte_array_with_invalid_args (
318318 strict_arrays_contract , transact , args
319319):
320- with pytest .raises (ValidationError ):
320+ with pytest .raises (Web3ValidationError ):
321321 transact (
322322 contract = strict_arrays_contract ,
323323 contract_function = "setByteValue" ,
@@ -644,13 +644,13 @@ def test_no_functions_match_identifier(arrays_contract):
644644
645645def test_function_1_match_identifier_wrong_number_of_args (arrays_contract ):
646646 regex = message_regex + diagnosis_arg_regex
647- with pytest .raises (ValidationError , match = regex ):
647+ with pytest .raises (Web3ValidationError , match = regex ):
648648 arrays_contract .functions .setBytes32Value ().call ()
649649
650650
651651def test_function_1_match_identifier_wrong_args_encoding (arrays_contract ):
652652 regex = message_regex + diagnosis_encoding_regex
653- with pytest .raises (ValidationError , match = regex ):
653+ with pytest .raises (Web3ValidationError , match = regex ):
654654 arrays_contract .functions .setBytes32Value ("dog" ).call ()
655655
656656
@@ -665,7 +665,7 @@ def test_function_1_match_identifier_wrong_args_encoding(arrays_contract):
665665def test_function_multiple_error_diagnoses (w3 , arg1 , arg2 , diagnosis ):
666666 Contract = w3 .eth .contract (abi = MULTIPLE_FUNCTIONS )
667667 regex = message_regex + diagnosis
668- with pytest .raises (ValidationError , match = regex ):
668+ with pytest .raises (Web3ValidationError , match = regex ):
669669 if arg2 :
670670 Contract .functions .a (arg1 , arg2 ).call ()
671671 else :
@@ -683,7 +683,7 @@ def test_function_wrong_args_for_tuple_collapses_args_in_message(
683683 address ,
684684 tuple_contract ,
685685):
686- with pytest .raises (ValidationError ) as e :
686+ with pytest .raises (Web3ValidationError ) as e :
687687 tuple_contract .functions .method (
688688 (1 , [2 , 3 ], [(4 , [True , [False ]], [address ])])
689689 ).call ()
@@ -711,7 +711,7 @@ def test_function_wrong_args_for_tuple_collapses_args_in_message(
711711def test_function_wrong_args_for_tuple_collapses_kwargs_in_message (
712712 address , tuple_contract
713713):
714- with pytest .raises (ValidationError ) as e :
714+ with pytest .raises (Web3ValidationError ) as e :
715715 tuple_contract .functions .method (
716716 a = (1 , [2 , 3 ], [(4 , [True , [False ]], [address ])]) # noqa: E501
717717 ).call ()
@@ -747,7 +747,7 @@ def test_call_not_sending_ether_to_nonpayable_function(payable_tester_contract,
747747
748748
749749def test_call_sending_ether_to_nonpayable_function (payable_tester_contract , call ):
750- with pytest .raises (ValidationError ):
750+ with pytest .raises (Web3ValidationError ):
751751 call (
752752 contract = payable_tester_contract ,
753753 contract_function = "doNoValueCall" ,
@@ -817,7 +817,7 @@ def test_invalid_fixed_value_reflections(
817817 fixed_reflection_contract , function , value , error
818818):
819819 contract_func = fixed_reflection_contract .functions [function ]
820- with pytest .raises (ValidationError , match = error ):
820+ with pytest .raises (Web3ValidationError , match = error ):
821821 contract_func (value ).call ({"gas" : 420000 })
822822
823823
@@ -1168,7 +1168,7 @@ async def test_async_set_strict_byte_array(
11681168async def test_async_set_strict_byte_array_with_invalid_args (
11691169 async_strict_arrays_contract , async_transact , args
11701170):
1171- with pytest .raises (ValidationError ):
1171+ with pytest .raises (Web3ValidationError ):
11721172 await async_transact (
11731173 contract = async_strict_arrays_contract ,
11741174 contract_function = "setByteValue" ,
@@ -1528,7 +1528,7 @@ async def test_async_function_1_match_identifier_wrong_number_of_args(
15281528 async_arrays_contract ,
15291529):
15301530 regex = message_regex + diagnosis_arg_regex
1531- with pytest .raises (ValidationError , match = regex ):
1531+ with pytest .raises (Web3ValidationError , match = regex ):
15321532 await async_arrays_contract .functions .setBytes32Value ().call ()
15331533
15341534
@@ -1537,7 +1537,7 @@ async def test_async_function_1_match_identifier_wrong_args_encoding(
15371537 async_arrays_contract ,
15381538):
15391539 regex = message_regex + diagnosis_encoding_regex
1540- with pytest .raises (ValidationError , match = regex ):
1540+ with pytest .raises (Web3ValidationError , match = regex ):
15411541 await async_arrays_contract .functions .setBytes32Value ("dog" ).call ()
15421542
15431543
@@ -1553,7 +1553,7 @@ async def test_async_function_1_match_identifier_wrong_args_encoding(
15531553async def test_async_function_multiple_diagnoses (async_w3 , arg1 , arg2 , diagnosis ):
15541554 Contract = async_w3 .eth .contract (abi = MULTIPLE_FUNCTIONS )
15551555 regex = message_regex + diagnosis
1556- with pytest .raises (ValidationError , match = regex ):
1556+ with pytest .raises (Web3ValidationError , match = regex ):
15571557 if arg2 :
15581558 await Contract .functions .a (arg1 , arg2 ).call ()
15591559 else :
@@ -1588,7 +1588,7 @@ async def test_async_call_not_sending_ether_to_nonpayable_function(
15881588async def test_async_call_sending_ether_to_nonpayable_function (
15891589 async_payable_tester_contract , async_call
15901590):
1591- with pytest .raises (ValidationError ):
1591+ with pytest .raises (Web3ValidationError ):
15921592 await async_call (
15931593 contract = async_payable_tester_contract ,
15941594 contract_function = "doNoValueCall" ,
@@ -1662,7 +1662,7 @@ async def test_async_invalid_fixed_value_reflections(
16621662 async_fixed_reflection_contract , function , value , error
16631663):
16641664 contract_func = async_fixed_reflection_contract .functions [function ]
1665- with pytest .raises (ValidationError , match = error ):
1665+ with pytest .raises (Web3ValidationError , match = error ):
16661666 await contract_func (value ).call ({"gas" : 420000 })
16671667
16681668
0 commit comments