Skip to content

Commit 56b3f13

Browse files
committed
Add match to DeprecationWarning check
1 parent b43a9ec commit 56b3f13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web3/_utils/module_testing/eth_module.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -850,9 +850,9 @@ def test_eth_estimateGas_with_block(
850850
def test_eth_getBlock_deprecated(
851851
self, web3: "Web3", empty_block: BlockData
852852
) -> None:
853-
with pytest.warns(DeprecationWarning):
853+
with pytest.warns(DeprecationWarning, match="getBlock is deprecated in favor of get_block"):
854854
block = web3.eth.getBlock(empty_block['hash'])
855-
assert block['hash'] == empty_block['hash']
855+
assert block['hash'] == empty_block['hash']
856856

857857
def test_eth_getBlockByHash(
858858
self, web3: "Web3", empty_block: BlockData
@@ -881,7 +881,7 @@ def test_eth_getBlockByNumber_with_integer(
881881
def test_eth_getBlockByNumber_with_integer_deprecated(
882882
self, web3: "Web3", empty_block: BlockData
883883
) -> None:
884-
with pytest.warns(DeprecationWarning, match=""):
884+
with pytest.warns(DeprecationWarning, match="getBlock is deprecated in favor of get_block"):
885885
block = web3.eth.getBlock(empty_block['number'])
886886
assert block['number'] == empty_block['number']
887887

0 commit comments

Comments
 (0)