File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ def test_web3exception_with_user_message():
13
13
14
14
15
15
def test_web3exception_with_kwargs ():
16
- with pytest .raises (Web3Exception ) as exception :
16
+ with pytest .raises (TypeError ) as exception :
17
17
raise Web3Exception (data = {"message" : "Unable to fulfill your request." })
18
- assert exception .type is Web3Exception
19
- assert exception .value . user_message is None
18
+ assert exception .type is TypeError
19
+ assert hasattr ( exception .value , "data" ) is False
20
20
assert (
21
- exception .value . kwargs [ "data" ][ "message" ] == "Unable to fulfill your request. "
21
+ str ( exception .value ) == "__init__() got an unexpected keyword argument 'data' "
22
22
)
23
23
24
24
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ def __init__(
34
34
self ,
35
35
* args : Any ,
36
36
user_message : Optional [str ] = None ,
37
- ** kwargs : Any ,
38
37
):
39
38
super ().__init__ (* args )
39
+
40
40
# Assign properties of Web3Exception
41
- self .__dict__ . update ( locals ())
41
+ self .user_message = user_message
42
42
43
43
44
44
class BadFunctionCallOutput (Web3Exception ):
You can’t perform that action at this time.
0 commit comments