@@ -2221,19 +2221,31 @@ async def test_eth_getBlockTransactionCountByHash_block_with_txn(
22212221 async def test_eth_getUncleCountByBlockHash (
22222222 self , async_w3 : "AsyncWeb3" , async_empty_block : BlockData
22232223 ) -> None :
2224- uncle_count = await async_w3 .eth .get_uncle_count (async_empty_block ["hash" ])
2224+ with pytest .warns (
2225+ DeprecationWarning ,
2226+ match = r"get_uncle_count is deprecated: all get_uncle\* "
2227+ r"methods will be removed in v8" ,
2228+ ):
2229+ uncle_count = await async_w3 .eth .get_uncle_count (async_empty_block ["hash" ])
22252230
2226- assert is_integer (uncle_count )
2227- assert uncle_count == 0
2231+ assert is_integer (uncle_count )
2232+ assert uncle_count == 0
22282233
22292234 @pytest .mark .asyncio
22302235 async def test_eth_getUncleCountByBlockNumber (
22312236 self , async_w3 : "AsyncWeb3" , async_empty_block : BlockData
22322237 ) -> None :
2233- uncle_count = await async_w3 .eth .get_uncle_count (async_empty_block ["number" ])
2238+ with pytest .warns (
2239+ DeprecationWarning ,
2240+ match = r"get_uncle_count is deprecated: all get_uncle\* "
2241+ r"methods will be removed in v8" ,
2242+ ):
2243+ uncle_count = await async_w3 .eth .get_uncle_count (
2244+ async_empty_block ["number" ]
2245+ )
22342246
2235- assert is_integer (uncle_count )
2236- assert uncle_count == 0
2247+ assert is_integer (uncle_count )
2248+ assert uncle_count == 0
22372249
22382250 @pytest .mark .asyncio
22392251 async def test_eth_getBlockTransactionCountByNumber_block_with_txn (
@@ -2843,18 +2855,24 @@ def test_eth_getBlockTransactionCountByNumber_block_with_txn(
28432855 def test_eth_getUncleCountByBlockHash (
28442856 self , w3 : "Web3" , empty_block : BlockData
28452857 ) -> None :
2846- uncle_count = w3 .eth .get_uncle_count (empty_block ["hash" ])
2858+ with pytest .warns (
2859+ DeprecationWarning , match = r"All get_uncle\* methods have been deprecated"
2860+ ):
2861+ uncle_count = w3 .eth .get_uncle_count (empty_block ["hash" ])
28472862
2848- assert is_integer (uncle_count )
2849- assert uncle_count == 0
2863+ assert is_integer (uncle_count )
2864+ assert uncle_count == 0
28502865
28512866 def test_eth_getUncleCountByBlockNumber (
28522867 self , w3 : "Web3" , empty_block : BlockData
28532868 ) -> None :
2854- uncle_count = w3 .eth .get_uncle_count (empty_block ["number" ])
2869+ with pytest .warns (
2870+ DeprecationWarning , match = r"All get_uncle\* methods have been deprecated"
2871+ ):
2872+ uncle_count = w3 .eth .get_uncle_count (empty_block ["number" ])
28552873
2856- assert is_integer (uncle_count )
2857- assert uncle_count == 0
2874+ assert is_integer (uncle_count )
2875+ assert uncle_count == 0
28582876
28592877 def test_eth_get_code (
28602878 self , w3 : "Web3" , math_contract_address : ChecksumAddress
0 commit comments