Skip to content

Commit 24d15cb

Browse files
stefanmendozacarver
authored andcommitted
Remove doctest dependency on ethtoken (#1395)
* Remove doctest dependency on ethtoken * Use testsetup directive for EIP20_ABI * Update broken link in README * Update README with Python 3.7 tox support * Add comment referencing the ABI to run locally
1 parent 8c12dc4 commit 24d15cb

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ pytest -n 4 -f --maxfail=1
109109

110110
2. Execute `tox` for the tests
111111

112-
There are multiple [components](https://github.com/ethereum/web3.py/blob/master/.travis.yml#L53) of the tests. You can run test to against specific component. For example:
112+
There are multiple [components](https://github.com/ethereum/web3.py/blob/master/.circleci/config.yml#L144) of the tests. You can run test to against specific component. For example:
113113

114114
```sh
115-
# Run Tests for the Core component (for Python 3.5):
116-
tox -e py35-core
117-
118115
# Run Tests for the Core component (for Python 3.6):
119116
tox -e py36-core
117+
118+
# Run Tests for the Core component (for Python 3.7):
119+
tox -e py37-core
120120
```
121121

122122
If for some reason it is not working, add `--recreate` params.

docs/web3.eth.account.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,18 @@ To sign a transaction locally that will invoke a smart contract:
264264

265265
.. testsetup::
266266

267+
import json
268+
267269
nonce = 0
268270

271+
EIP20_ABI = json.loads('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}]') # noqa: 501
272+
273+
269274
.. doctest::
270275

271-
>>> from ethtoken.abi import EIP20_ABI
276+
# When running locally, execute the statements found in the file linked below to load the EIP20_ABI variable.
277+
# See: https://github.com/carver/ethtoken.py/blob/v0.0.1-alpha.4/ethtoken/abi.py
278+
272279
>>> from web3.auto import w3
273280

274281
>>> unicorns = w3.eth.contract(address="0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359", abi=EIP20_ABI)

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"click>=5.1",
2121
"configparser==3.5.0",
2222
"contextlib2>=0.5.4",
23-
"ethtoken",
2423
"py-geth>=1.4.0",
2524
"py-solc>=0.4.0",
2625
"pytest>=4.4.0,<5.0.0",

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ commands=
4141
deps =
4242
.[dev]
4343
doctest: sphinx
44-
doctest: ethtoken
4544
passenv =
4645
GETH_BINARY
4746
GETH_VERSION

0 commit comments

Comments
 (0)