Skip to content

Commit 4aaa1e3

Browse files
committed
Use pytest xfail marker, and pytest match error
1 parent 4204fd5 commit 4aaa1e3

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

tests/integration/go_ethereum/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ def test_eth_chainId(self, web3):
7171
pytest.xfail('eth_chainId not implemented in geth 1.7.2')
7272
super().test_eth_chainId(web3)
7373

74+
@pytest.mark.xfail(reason='eth_signTypedData has not been released in geth')
7475
def test_eth_signTypedData(self,
7576
web3,
7677
unlocked_account_dual_type):
77-
pytest.xfail('eth_signTypedData JSON RPC call has not been released in geth')
7878
super().test_eth_signTypedData(
7979
web3, unlocked_account_dual_type
8080
)
8181

82+
@pytest.mark.xfail(reason='eth_signTypedData has not been released in geth')
8283
def test_invalid_eth_signTypedData(self,
8384
web3,
8485
unlocked_account_dual_type):
85-
pytest.xfail('eth_signTypedData JSON RPC call has not been released in geth')
8686
super().test_invalid_eth_signTypedData(
8787
web3, unlocked_account_dual_type
8888
)

tests/integration/parity/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,18 @@ def test_eth_getLogs_without_logs(self, web3, block_with_txn_with_log):
168168
result = web3.eth.getLogs(filter_params)
169169
assert len(result) == 0
170170

171+
@pytest.mark.xfail(reason='eth_signTypedData has not been released in Parity')
171172
def test_eth_signTypedData(self,
172173
web3,
173174
unlocked_account_dual_type):
174-
pytest.xfail('eth_signTypedData JSON RPC call has not been released in parity')
175175
super().test_eth_signTypedData(
176176
web3, unlocked_account_dual_type
177177
)
178178

179+
@pytest.mark.xfail(reason='eth_signTypedData has not been released in Parity')
179180
def test_invalid_eth_signTypedData(self,
180181
web3,
181182
unlocked_account_dual_type):
182-
pytest.xfail('eth_signTypedData JSON RPC call has not been released in parity')
183183
super().test_invalid_eth_signTypedData(
184184
web3, unlocked_account_dual_type
185185
)

web3/_utils/module_testing/eth_module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,12 @@ def test_invalid_eth_signTypedData(self,
294294
}
295295
}
296296
'''
297-
with pytest.raises(ValueError) as e:
297+
with pytest.raises(ValueError,
298+
match=r".*Expected 2 items for array type Person\[2\], got 1 items.*"):
298299
web3.eth.signTypedData(
299300
unlocked_account_dual_type,
300301
json.loads(invalid_typed_message)
301302
)
302-
assert "Expected 2 items for array type Person[2], got 1 items" in str(e.value)
303303

304304
def test_eth_signTransaction(self, web3, unlocked_account):
305305
txn_params = {

web3/_utils/module_testing/personal_module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,10 @@ def test_invalid_personal_sign_typed_data(self,
332332
}
333333
}
334334
'''
335-
with pytest.raises(ValueError) as e:
335+
with pytest.raises(ValueError,
336+
match=r".*Expected 2 items for array type Person\[2\], got 1 items.*"):
336337
web3.parity.personal.signTypedData(
337338
json.loads(invalid_typed_message),
338339
unlockable_account_dual_type,
339340
unlockable_account_pw
340341
)
341-
assert "Expected 2 items for array type Person[2], got 1 items" in str(e.value)

0 commit comments

Comments
 (0)