Skip to content

Commit

Permalink
Merge pull request #141 from pipermerriam/piper/fix-dependency-issue
Browse files Browse the repository at this point in the history
Remove testrpc import requirement
  • Loading branch information
pipermerriam committed Dec 30, 2016
2 parents d765a28 + 00c9187 commit a7a6d83
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/contracts/test_contract_estimateGas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/eth-module/test_eth_estimateGas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions web3/providers/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import gevent

from testrpc.rpc import RPCMethods

from .base import BaseProvider # noqa: E402
from .rpc import RPCProvider # noqa: E402

Expand All @@ -23,14 +21,17 @@ 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`
:param network_timeout: See :class:`geventhttpclient.HTTPClient`
"""
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)

Expand Down
1 change: 1 addition & 0 deletions web3/utils/exception_py2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys


def raise_from(my_exception, other_exception):
raise my_exception, None, sys.exc_info()[2] # noqa: W602, E999

0 comments on commit a7a6d83

Please sign in to comment.