diff --git a/tests/contracts/test_contract_estimateGas.py b/tests/contracts/test_contract_estimateGas.py index 365c26f..8ffd901 100644 --- a/tests/contracts/test_contract_estimateGas.py +++ b/tests/contracts/test_contract_estimateGas.py @@ -36,7 +36,7 @@ def test_contract_estimateGas(web3, math_contract): gas_estimate = math_contract.estimateGas().increment() try: - assert abs(gas_estimate - 21272) < 200 # Geth + assert abs(gas_estimate - 21472) < 200 # Geth except AssertionError: - assert abs(gas_estimate - 42820) < 200 # TestRPC + assert abs(gas_estimate - 43020) < 200 # TestRPC pass diff --git a/tests/eth-module/test_eth_estimateGas.py b/tests/eth-module/test_eth_estimateGas.py index 18c8faf..992236f 100644 --- a/tests/eth-module/test_eth_estimateGas.py +++ b/tests/eth-module/test_eth_estimateGas.py @@ -40,7 +40,7 @@ def test_eth_estimateGas(web3, math_contract): }) try: - assert abs(gas_estimate - 21272) < 200 # Geth + assert abs(gas_estimate - 21472) < 200 # Geth except AssertionError: - assert abs(gas_estimate - 42820) < 200 # TestRPC + assert abs(gas_estimate - 43020) < 200 # TestRPC pass diff --git a/web3/providers/tester.py b/web3/providers/tester.py index a5b3149..c47c866 100644 --- a/web3/providers/tester.py +++ b/web3/providers/tester.py @@ -2,8 +2,6 @@ import logging import gevent -from testrpc.rpc import RPCMethods - from .base import BaseProvider # noqa: E402 from .rpc import RPCProvider # noqa: E402 @@ -23,7 +21,8 @@ class EthereumTesterProvider(BaseProvider): def __init__(self, *args, **kwargs): - """Create a new RPC client. + """ + Create a new RPC client. :param connection_timeout: See :class:`geventhttpclient.HTTPClient` @@ -31,6 +30,8 @@ class EthereumTesterProvider(BaseProvider): """ if not is_testrpc_available(): raise Exception("`TestRPCProvider` requires the `eth-testrpc` package to be installed") + from testrpc.rpc import RPCMethods + self.rpc_methods = RPCMethods() super(BaseProvider, self).__init__(*args, **kwargs) diff --git a/web3/utils/exception_py2.py b/web3/utils/exception_py2.py index e554a01..e0a5cda 100644 --- a/web3/utils/exception_py2.py +++ b/web3/utils/exception_py2.py @@ -1,4 +1,5 @@ import sys + def raise_from(my_exception, other_exception): raise my_exception, None, sys.exc_info()[2] # noqa: W602, E999