Skip to content

Commit

Permalink
Remove warnings from asyncio version module specs
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Oct 21, 2019
1 parent 226242f commit 195bd93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions newsfragments/1476.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove warnings from asyncio version module tests
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"flaky>=3.3.0",
"hypothesis>=3.31.2",
"pytest>=4.4.0,<5.0.0",
"pytest-asyncio>=0.10.0,<0.11",
"pytest-mock>=1.10,<2",
"pytest-pythonpath>=0.3",
"pytest-watch>=4.2,<5",
Expand Down
16 changes: 8 additions & 8 deletions tests/core/version-module/test_version_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
EthereumTesterProvider,
Web3,
)
from web3.eth import (
Eth,
)
from web3.providers.eth_tester.main import (
AsyncEthereumTesterProvider,
)
Expand All @@ -24,6 +27,7 @@ def blocking_w3():
modules={
"blocking_version": (BlockingVersion,),
"legacy_version": (Version,),
"eth": (Eth,),
})


Expand All @@ -46,11 +50,7 @@ def test_legacy_version_deprecation(blocking_w3):

@pytest.mark.asyncio
async def test_async_blocking_version(async_w3, blocking_w3):
assert async_w3.async_version.api == blocking_w3.legacy_version.api

assert await async_w3.async_version.node == blocking_w3.legacy_version.node
with pytest.raises(
ValueError,
message="RPC Endpoint has not been implemented: eth_protocolVersion"
):
assert await async_w3.async_version.ethereum == blocking_w3.legacy_version.ethereum
assert async_w3.async_version.api == blocking_w3.api

assert await async_w3.async_version.node == blocking_w3.clientVersion
assert await async_w3.async_version.ethereum == int(blocking_w3.eth.protocolVersion)

0 comments on commit 195bd93

Please sign in to comment.