Skip to content

Commit

Permalink
Rename some async tests to use conventional 'async' in name
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Dec 29, 2023
1 parent 9f5e8e5 commit 1b6016c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/core/eth-module/test_eth_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)


def test_Eth_filter_creates_correct_filter_type(w3):
def test_eth_filter_creates_correct_filter_type(w3):
filter1 = w3.eth.filter("latest")
assert isinstance(filter1, BlockFilter)
filter2 = w3.eth.filter("pending")
Expand All @@ -41,7 +41,7 @@ async def async_w3():


@pytest.mark.asyncio
async def test_AsyncEth_filter_creates_correct_filter_type(async_w3):
async def test_async_eth_filter_creates_correct_filter_type(async_w3):
filter1 = await async_w3.eth.filter("latest")
assert isinstance(filter1, AsyncBlockFilter)
filter2 = await async_w3.eth.filter("pending")
Expand Down
4 changes: 2 additions & 2 deletions tests/core/providers/test_async_http_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def clean_async_session_cache():


@pytest.mark.asyncio
async def test_no_args() -> None:
async def test_async_no_args() -> None:
provider = AsyncHTTPProvider()
w3 = AsyncWeb3(provider)
assert w3.manager.provider == provider
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_web3_with_async_http_provider_has_default_middlewares_and_modules() ->


@pytest.mark.asyncio
async def test_user_provided_session() -> None:
async def test_async_user_provided_session() -> None:
session = ClientSession()
provider = AsyncHTTPProvider(endpoint_uri=URI)
cached_session = await provider.cache_async_session(session)
Expand Down
22 changes: 11 additions & 11 deletions tests/core/utilities/test_async_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@
}


@pytest.mark.asyncio()
async def test_get_block_gas_limit_with_block_number(async_w3):
@pytest.mark.asyncio
async def test_async_get_block_gas_limit_with_block_number(async_w3):
gas_limit = await get_block_gas_limit(async_w3.eth, BlockNumber(0))
assert isinstance(gas_limit, int)


@pytest.mark.asyncio()
async def test_get_block_gas_limit_without_block_number(async_w3):
@pytest.mark.asyncio
async def test_async_get_block_gas_limit_without_block_number(async_w3):
gas_limit = await get_block_gas_limit(async_w3.eth)
assert isinstance(gas_limit, int)


@pytest.mark.asyncio()
async def test_get_buffered_gas_estimate(async_w3):
@pytest.mark.asyncio
async def test_async_get_buffered_gas_estimate(async_w3):
txn_params = {
"data": b"0x1",
}
Expand All @@ -50,8 +50,8 @@ async def test_get_buffered_gas_estimate(async_w3):
assert buffered_gas_estimate == min(gas_estimate + gas_buffer, gas_limit)


@pytest.mark.asyncio()
async def test_fill_transaction_defaults_for_all_params(async_w3):
@pytest.mark.asyncio
async def test_async_fill_transaction_defaults_for_all_params(async_w3):
default_transaction = await async_fill_transaction_defaults(async_w3, {})

block = await async_w3.eth.get_block("latest")
Expand All @@ -68,7 +68,7 @@ async def test_fill_transaction_defaults_for_all_params(async_w3):


@pytest.mark.asyncio()
async def test_fill_transaction_defaults_nondynamic_tranaction_fee(async_w3):
async def test_async_fill_transaction_defaults_nondynamic_tranaction_fee(async_w3):
gasPrice_transaction = {
"gasPrice": 10,
}
Expand All @@ -79,8 +79,8 @@ async def test_fill_transaction_defaults_nondynamic_tranaction_fee(async_w3):
assert none_in_dict(DYNAMIC_FEE_TXN_PARAMS, default_transaction)


@pytest.mark.asyncio()
async def test_fill_transaction_defaults_for_zero_gas_price(async_w3):
@pytest.mark.asyncio
async def test_async_fill_transaction_defaults_for_zero_gas_price(async_w3):
def gas_price_strategy(_w3, tx):
return 0

Expand Down

0 comments on commit 1b6016c

Please sign in to comment.