From 02da2286e93c2fa6895563efc47f7e5040df2368 Mon Sep 17 00:00:00 2001 From: Nick Gheorghita Date: Sat, 15 Dec 2018 18:59:19 +0100 Subject: [PATCH] Minor adjustments from updated dependencies --- setup.py | 2 +- tests/core/pm-module/conftest.py | 5 +---- tests/core/pm-module/test_ens_integration.py | 7 ++----- tests/core/providers/test_websocket_provider.py | 4 ++-- tests/generate_go_ethereum_fixture.py | 2 +- tests/integration/generate_fixtures/go_ethereum.py | 4 ++-- tests/integration/generate_fixtures/parity.py | 6 +++--- tests/integration/go_ethereum/test_goethereum_http.py | 1 - tests/integration/go_ethereum/test_goethereum_ipc.py | 1 - tests/integration/go_ethereum/test_goethereum_ws.py | 1 - tests/integration/parity/test_parity_http.py | 1 - tests/integration/parity/test_parity_ipc.py | 1 - tests/integration/parity/test_parity_ws.py | 1 - web3/pm.py | 2 +- 14 files changed, 13 insertions(+), 25 deletions(-) diff --git a/setup.py b/setup.py index c7cdbb327d..e740045afb 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,6 @@ 'tester': [ "eth-tester[py-evm]==0.1.0-beta.36", "py-geth>=2.0.1,<3.0.0", - "pytest-ethereum>=0.1.3a6,<1", ], 'testrpc': ["eth-testrpc>=1.3.3,<2.0.0"], 'linter': [ @@ -75,6 +74,7 @@ "ethpm>=0.1.4a10,<1", "hexbytes>=0.1.0,<1.0.0", "lru-dict>=1.1.6,<2.0.0", + "pytest-ethereum>=0.1.3a6,<1", "requests>=2.16.0,<3.0.0", "websockets>=7.0.0,<8.0.0", "pypiwin32>=223;platform_system=='Windows'", diff --git a/tests/core/pm-module/conftest.py b/tests/core/pm-module/conftest.py index b9df3271a8..b65412c6ab 100644 --- a/tests/core/pm-module/conftest.py +++ b/tests/core/pm-module/conftest.py @@ -24,9 +24,6 @@ from pytest_ethereum.deployer import ( Deployer, ) -from pytest_ethereum.plugins import ( - twig_manifest, -) from web3 import Web3 from web3.pm import ( @@ -173,7 +170,7 @@ def sol_registry(w3): def vy_registry(w3): registry_path = ASSETS_DIR / "vyper_registry" - manifest = twig_manifest(registry_path, "registry", "1.0.0") + manifest = json.loads((registry_path / "1.0.0.json").read_text().rstrip('\n')) registry_package = Package(manifest, w3) registry_deployer = Deployer(registry_package) deployed_registry_package = registry_deployer.deploy("registry") diff --git a/tests/core/pm-module/test_ens_integration.py b/tests/core/pm-module/test_ens_integration.py index 5dce1c638e..30d7e96ab6 100644 --- a/tests/core/pm-module/test_ens_integration.py +++ b/tests/core/pm-module/test_ens_integration.py @@ -26,14 +26,11 @@ def bytes32(val): return result.rjust(32, b'\0') -pytest_plugins = ["pytest_ethereum.plugins"] - - @pytest.fixture -def ens_setup(solc_deployer): +def ens_setup(deployer): # todo: move to module level once ethpm alpha stable ENS_MANIFEST = ASSETS_DIR / 'ens' / '1.0.1.json' - ens_deployer = solc_deployer(ENS_MANIFEST) + ens_deployer = deployer(ENS_MANIFEST) w3 = ens_deployer.package.w3 # ** Set up ENS contracts ** diff --git a/tests/core/providers/test_websocket_provider.py b/tests/core/providers/test_websocket_provider.py index 7c04e8198b..789fbe2225 100644 --- a/tests/core/providers/test_websocket_provider.py +++ b/tests/core/providers/test_websocket_provider.py @@ -7,11 +7,11 @@ Thread, ) +import websockets + from tests.utils import ( wait_for_ws, ) -import websockets - from web3 import Web3 from web3.exceptions import ( ValidationError, diff --git a/tests/generate_go_ethereum_fixture.py b/tests/generate_go_ethereum_fixture.py index 13cdaf5a02..90e593ffbe 100644 --- a/tests/generate_go_ethereum_fixture.py +++ b/tests/generate_go_ethereum_fixture.py @@ -21,10 +21,10 @@ to_text, to_wei, ) + from tests.utils import ( get_open_port, ) - from web3 import Web3 from web3._utils.module_testing.emitter_contract import ( EMITTER_ABI, diff --git a/tests/integration/generate_fixtures/go_ethereum.py b/tests/integration/generate_fixtures/go_ethereum.py index 0d50eec3e7..b9a0e7a83d 100644 --- a/tests/integration/generate_fixtures/go_ethereum.py +++ b/tests/integration/generate_fixtures/go_ethereum.py @@ -9,11 +9,11 @@ is_dict, is_same_address, ) + +import common from tests.utils import ( get_open_port, ) - -import common from web3 import Web3 from web3._utils.module_testing.emitter_contract import ( EMITTER_ABI, diff --git a/tests/integration/generate_fixtures/parity.py b/tests/integration/generate_fixtures/parity.py index 393b3d4562..a1c8ec0423 100644 --- a/tests/integration/generate_fixtures/parity.py +++ b/tests/integration/generate_fixtures/parity.py @@ -9,12 +9,12 @@ from eth_utils import ( to_text, ) -from tests.utils import ( - get_open_port, -) import common import go_ethereum +from tests.utils import ( + get_open_port, +) from web3 import Web3 from web3._utils.toolz import ( merge, diff --git a/tests/integration/go_ethereum/test_goethereum_http.py b/tests/integration/go_ethereum/test_goethereum_http.py index 1e611f72cf..251e558ead 100644 --- a/tests/integration/go_ethereum/test_goethereum_http.py +++ b/tests/integration/go_ethereum/test_goethereum_http.py @@ -3,7 +3,6 @@ from tests.utils import ( get_open_port, ) - from web3 import Web3 from .common import ( diff --git a/tests/integration/go_ethereum/test_goethereum_ipc.py b/tests/integration/go_ethereum/test_goethereum_ipc.py index 8b923b3951..8bc53ff6f9 100644 --- a/tests/integration/go_ethereum/test_goethereum_ipc.py +++ b/tests/integration/go_ethereum/test_goethereum_ipc.py @@ -5,7 +5,6 @@ from tests.utils import ( get_open_port, ) - from web3 import Web3 from .common import ( diff --git a/tests/integration/go_ethereum/test_goethereum_ws.py b/tests/integration/go_ethereum/test_goethereum_ws.py index ba69412bfc..5166bae242 100644 --- a/tests/integration/go_ethereum/test_goethereum_ws.py +++ b/tests/integration/go_ethereum/test_goethereum_ws.py @@ -7,7 +7,6 @@ get_open_port, wait_for_ws, ) - from web3 import Web3 from .common import ( diff --git a/tests/integration/parity/test_parity_http.py b/tests/integration/parity/test_parity_http.py index 31d8a190d7..1b0ad45458 100644 --- a/tests/integration/parity/test_parity_http.py +++ b/tests/integration/parity/test_parity_http.py @@ -7,7 +7,6 @@ from tests.utils import ( get_open_port, ) - from web3 import Web3 from web3._utils.module_testing import ( NetModuleTest, diff --git a/tests/integration/parity/test_parity_ipc.py b/tests/integration/parity/test_parity_ipc.py index 1fb72f3eae..48dc537875 100644 --- a/tests/integration/parity/test_parity_ipc.py +++ b/tests/integration/parity/test_parity_ipc.py @@ -5,7 +5,6 @@ from tests.integration.parity.utils import ( wait_for_socket, ) - from web3 import Web3 from web3._utils.module_testing import ( NetModuleTest, diff --git a/tests/integration/parity/test_parity_ws.py b/tests/integration/parity/test_parity_ws.py index cb855a0648..3d24520818 100644 --- a/tests/integration/parity/test_parity_ws.py +++ b/tests/integration/parity/test_parity_ws.py @@ -8,7 +8,6 @@ get_open_port, wait_for_ws, ) - from web3 import Web3 from web3._utils.module_testing import ( NetModuleTest, diff --git a/web3/pm.py b/web3/pm.py index 68497b71d8..d27f136282 100644 --- a/web3/pm.py +++ b/web3/pm.py @@ -419,7 +419,7 @@ def set_registry(self, address: Address) -> None: self.registry = VyperReferenceRegistry(canonical_address, self.web3) elif is_ens_name(address): self._validate_set_ens() - addr_lookup = self.web3.ens.address(address, guess_tld=False) + addr_lookup = self.web3.ens.address(address) if not addr_lookup: raise NameNotFound( "No address found after ENS lookup for name: {0}.".format(address)