Merge pull request #141 from pipermerriam/piper/fix-dependency-issue

Remove testrpc import requirement
This commit is contained in:
Piper Merriam 2016-12-30 12:05:25 -07:00 committed by GitHub
commit a7a6d83de5
4 changed files with 9 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -1,4 +1,5 @@
import sys
def raise_from(my_exception, other_exception):
raise my_exception, None, sys.exc_info()[2] # noqa: W602, E999