Skip to content

Commit

Permalink
Use pytest xfail marker, and pytest match error
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed May 1, 2019
1 parent 4204fd5 commit 4aaa1e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/integration/go_ethereum/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,18 @@ def test_eth_chainId(self, web3):
pytest.xfail('eth_chainId not implemented in geth 1.7.2')
super().test_eth_chainId(web3)

@pytest.mark.xfail(reason='eth_signTypedData has not been released in geth')
def test_eth_signTypedData(self,
web3,
unlocked_account_dual_type):
pytest.xfail('eth_signTypedData JSON RPC call has not been released in geth')
super().test_eth_signTypedData(
web3, unlocked_account_dual_type
)

@pytest.mark.xfail(reason='eth_signTypedData has not been released in geth')
def test_invalid_eth_signTypedData(self,
web3,
unlocked_account_dual_type):
pytest.xfail('eth_signTypedData JSON RPC call has not been released in geth')
super().test_invalid_eth_signTypedData(
web3, unlocked_account_dual_type
)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/parity/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,18 @@ def test_eth_getLogs_without_logs(self, web3, block_with_txn_with_log):
result = web3.eth.getLogs(filter_params)
assert len(result) == 0

@pytest.mark.xfail(reason='eth_signTypedData has not been released in Parity')
def test_eth_signTypedData(self,
web3,
unlocked_account_dual_type):
pytest.xfail('eth_signTypedData JSON RPC call has not been released in parity')
super().test_eth_signTypedData(
web3, unlocked_account_dual_type
)

@pytest.mark.xfail(reason='eth_signTypedData has not been released in Parity')
def test_invalid_eth_signTypedData(self,
web3,
unlocked_account_dual_type):
pytest.xfail('eth_signTypedData JSON RPC call has not been released in parity')
super().test_invalid_eth_signTypedData(
web3, unlocked_account_dual_type
)
Expand Down
4 changes: 2 additions & 2 deletions web3/_utils/module_testing/eth_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ def test_invalid_eth_signTypedData(self,
}
}
'''
with pytest.raises(ValueError) as e:
with pytest.raises(ValueError,
match=r".*Expected 2 items for array type Person\[2\], got 1 items.*"):
web3.eth.signTypedData(
unlocked_account_dual_type,
json.loads(invalid_typed_message)
)
assert "Expected 2 items for array type Person[2], got 1 items" in str(e.value)

def test_eth_signTransaction(self, web3, unlocked_account):
txn_params = {
Expand Down
4 changes: 2 additions & 2 deletions web3/_utils/module_testing/personal_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ def test_invalid_personal_sign_typed_data(self,
}
}
'''
with pytest.raises(ValueError) as e:
with pytest.raises(ValueError,
match=r".*Expected 2 items for array type Person\[2\], got 1 items.*"):
web3.parity.personal.signTypedData(
json.loads(invalid_typed_message),
unlockable_account_dual_type,
unlockable_account_pw
)
assert "Expected 2 items for array type Person[2], got 1 items" in str(e.value)

0 comments on commit 4aaa1e3

Please sign in to comment.