Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit f996f22

Browse files
committed
Change travis to run all checks using py 3.5
Also make it run all tests (except those in todo_tests), as they're all passing now!
1 parent eb5795f commit f996f22

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
language: python
2-
python: 2.7
2+
python: 3.5
33
sudo: required
44
dist: trusty
55
env:
6+
# XXX: There are too many tests failing on py2.7, so disable this for now.
67
#matrix:
78
#- TOX_ENV=py27
89
#- TOX_ENV=py34
@@ -30,12 +31,13 @@ install:
3031
- travis_retry python setup.py install
3132
- travis_retry pip install -r dev_requirements.txt
3233
script:
33-
# XXX: For now we're only performing minimal CI checks as most tests are
34-
# broken. Tests will be individually added here as they're fixed.
34+
# XXX: For now we're only performing minimal lint checks as there are way
35+
# too many issues. Once they're all addressed we should change this to 'make
36+
# lint'.
3537
- make lint-minimal
36-
- make test-passing
38+
- make test
3739
#- if [ -d .tox/$TOX_ENV/ ]; then cd .tox/$TOX_ENV && coverage erase; fi;
38-
#- tox -e $TOX_ENV -- --ignore ethereum/tests/test_vm.py --ignore ethereum/tests/test_state.py
40+
#- tox -e $TOX_ENV -- --ignore ethereum/tests/test_vm.py --ignore ethereum/tests/test_state.py --ignore ethereum/todo_tests
3941
#- tox -e $TOX_ENV -- ethereum/tests/test_vm.py
4042
#- tox -e $TOX_ENV -- ethereum/tests/test_state.py
4143
#- coverage report --show-missing

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,10 @@ lint-minimal:
4343
python -m flake8 --ignore=F401,F841,F811 --select=F --exclude=todo,experimental,ethash.py,ethash_utils.py ethereum
4444

4545
test:
46-
py.test --tb=no ethereum/tests/
46+
py.test ethereum/tests/
4747

48-
test-passing:
49-
py.test ethereum/tests/test_abi.py ethereum/tests/test_bloom.py ethereum/tests/test_chain.py ethereum/tests/test_compress.py ethereum/tests/test_db.py ethereum/tests/test_difficulty.py ethereum/tests/test_opcodes.py ethereum/tests/test_trie_next_prev.py ethereum/tests/test_genesis.py ethereum/tests/test_serialization.py ethereum/tests/test_trie.py
50-
51-
test-failing:
52-
py.test ethereum/tests/test_blockstransactions.py ethereum/tests/test_transactions.py ethereum/tests/test_keys.py ethereum/tests/test_state.py ethereum/tests/test_contracts.py ethereum/tests/test_tester.py
48+
test-todo:
49+
py.test --continue-on-collection-errors ethereum/todo_tests
5350

5451
testnovm:
5552
py.test --tb=no ethereum/tests/ --ignore=ethereum/tests/test_vm.py

ethereum/pow/chain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def get_tx_position(self, tx):
372372
def get_transaction(self, tx):
373373
print('Deprecated. Use get_tx_position')
374374
blknum, index = self.get_tx_position(tx)
375-
blk = self.get_block_by_number(blknum)
375+
blk = self.get_block_by_number(blknum)
376376
return blk.transactions[index], blk, index
377377

378378
# Get descendants of a block
@@ -397,7 +397,7 @@ def get_blockhashes_from_hash(self, hash, max):
397397

398398
header = block.header
399399
hashes = []
400-
for i in xrange(max):
400+
for i in range(max):
401401
hash = header.prevhash
402402
block = self.get_block(hash)
403403
if block is None:

ethereum/slogging.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import json
3+
import sys
34
import textwrap
45
from json.encoder import JSONEncoder
56
from logging import StreamHandler, Formatter, FileHandler
@@ -256,11 +257,15 @@ def getLogger(self, name):
256257

257258

258259
def _stringify_dict_keys(input_):
260+
if sys.version_info.major == 2:
261+
longType = long # NOQA
262+
else:
263+
longType = int
259264
if isinstance(input_, dict):
260265
res = {}
261266
for k, v in input_.items():
262267
v = _stringify_dict_keys(v)
263-
if not isinstance(k, (int, long, bool, None.__class__)):
268+
if not isinstance(k, (int, longType, bool, None.__class__)):
264269
k = str(k)
265270
res[k] = v
266271
elif isinstance(input_, (list, tuple)):

ethereum/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
SECP256K1P = 2**256 - 4294968273
3030

3131
if sys.version_info.major == 2:
32-
is_numeric = lambda x: isinstance(x, (int, long))
33-
is_string = lambda x: isinstance(x, (str, unicode))
32+
is_numeric = lambda x: isinstance(x, (int, long)) # NOQA
33+
is_string = lambda x: isinstance(x, (str, unicode)) # NOQA
3434

3535
def to_string(value):
3636
return str(value)
@@ -42,7 +42,7 @@ def int_to_bytes(value):
4242

4343
def to_string_for_regexp(value):
4444
return str(value)
45-
unicode = unicode
45+
unicode = unicode # NOQA
4646

4747
def bytearray_to_bytestr(value):
4848
return bytes(''.join(chr(c) for c in value))

0 commit comments

Comments
 (0)