From 195bd933e9583dabdabf29976e4de2d9b77d0919 Mon Sep 17 00:00:00 2001 From: Keri Date: Mon, 21 Oct 2019 11:24:08 -0600 Subject: [PATCH] Remove warnings from asyncio version module specs --- newsfragments/1476.misc.rst | 1 + setup.py | 1 + tests/core/version-module/test_version_module.py | 16 ++++++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 newsfragments/1476.misc.rst diff --git a/newsfragments/1476.misc.rst b/newsfragments/1476.misc.rst new file mode 100644 index 0000000000..3059c87959 --- /dev/null +++ b/newsfragments/1476.misc.rst @@ -0,0 +1 @@ +Remove warnings from asyncio version module tests diff --git a/setup.py b/setup.py index 737cc69159..bea2079133 100644 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/tests/core/version-module/test_version_module.py b/tests/core/version-module/test_version_module.py index bd56d771d6..8138a72f72 100644 --- a/tests/core/version-module/test_version_module.py +++ b/tests/core/version-module/test_version_module.py @@ -4,6 +4,9 @@ EthereumTesterProvider, Web3, ) +from web3.eth import ( + Eth, +) from web3.providers.eth_tester.main import ( AsyncEthereumTesterProvider, ) @@ -24,6 +27,7 @@ def blocking_w3(): modules={ "blocking_version": (BlockingVersion,), "legacy_version": (Version,), + "eth": (Eth,), }) @@ -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)