@@ -2221,19 +2221,31 @@ async def test_eth_getBlockTransactionCountByHash_block_with_txn(
2221
2221
async def test_eth_getUncleCountByBlockHash (
2222
2222
self , async_w3 : "AsyncWeb3" , async_empty_block : BlockData
2223
2223
) -> 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" ])
2225
2230
2226
- assert is_integer (uncle_count )
2227
- assert uncle_count == 0
2231
+ assert is_integer (uncle_count )
2232
+ assert uncle_count == 0
2228
2233
2229
2234
@pytest .mark .asyncio
2230
2235
async def test_eth_getUncleCountByBlockNumber (
2231
2236
self , async_w3 : "AsyncWeb3" , async_empty_block : BlockData
2232
2237
) -> 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
+ )
2234
2246
2235
- assert is_integer (uncle_count )
2236
- assert uncle_count == 0
2247
+ assert is_integer (uncle_count )
2248
+ assert uncle_count == 0
2237
2249
2238
2250
@pytest .mark .asyncio
2239
2251
async def test_eth_getBlockTransactionCountByNumber_block_with_txn (
@@ -2843,18 +2855,24 @@ def test_eth_getBlockTransactionCountByNumber_block_with_txn(
2843
2855
def test_eth_getUncleCountByBlockHash (
2844
2856
self , w3 : "Web3" , empty_block : BlockData
2845
2857
) -> 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" ])
2847
2862
2848
- assert is_integer (uncle_count )
2849
- assert uncle_count == 0
2863
+ assert is_integer (uncle_count )
2864
+ assert uncle_count == 0
2850
2865
2851
2866
def test_eth_getUncleCountByBlockNumber (
2852
2867
self , w3 : "Web3" , empty_block : BlockData
2853
2868
) -> 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" ])
2855
2873
2856
- assert is_integer (uncle_count )
2857
- assert uncle_count == 0
2874
+ assert is_integer (uncle_count )
2875
+ assert uncle_count == 0
2858
2876
2859
2877
def test_eth_get_code (
2860
2878
self , w3 : "Web3" , math_contract_address : ChecksumAddress
0 commit comments