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

Commit

Permalink
Change travis to run all checks using py 3.5
Browse files Browse the repository at this point in the history
Also make it run all tests (except those in todo_tests), as they're all
passing now!
  • Loading branch information
gsalgado committed Jun 21, 2017
1 parent 72870a5 commit b052745
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: python
python: 2.7
python: 3.5
sudo: required
dist: trusty
env:
# XXX: There are too many tests failing on py2.7, so disable this for now.
#matrix:
#- TOX_ENV=py27
#- TOX_ENV=py34
Expand Down Expand Up @@ -30,18 +31,19 @@ install:
- travis_retry python setup.py install
- travis_retry pip install -r dev_requirements.txt
script:
# XXX: For now we're only performing minimal CI checks as most tests are
# broken. Tests will be individually added here as they're fixed.
# XXX: For now we're only performing minimal lint checks as there are way
# too many issues. Once they're all addressed we should change this to 'make
# lint'.
- make lint-minimal
- make test-passing
- make test
#- if [ -d .tox/$TOX_ENV/ ]; then cd .tox/$TOX_ENV && coverage erase; fi;
#- tox -e $TOX_ENV -- --ignore ethereum/tests/test_vm.py --ignore ethereum/tests/test_state.py
#- tox -e $TOX_ENV -- --ignore ethereum/tests/test_vm.py --ignore ethereum/tests/test_state.py --ignore ethereum/todo_tests
#- tox -e $TOX_ENV -- ethereum/tests/test_vm.py
#- tox -e $TOX_ENV -- ethereum/tests/test_state.py
#- coverage report --show-missing
after_success:
- travis_retry pip install coveralls
- cd .tox/$TOX_ENV && coveralls
#- travis_retry pip install coveralls
#- cd .tox/$TOX_ENV && coveralls
notifications:
slack:
secure: W/UAhQ/GgYwMWrl3aiVAVOWr4WGdWrxUOX/rTB3ZgwDwGqDYLzQO5UqbsQlo1JXPZ6JOWfIPMURhHu7DSfue9dBW6xQ+NL+bFHe9lSXG4nqFK3IjezYyTBzNRJRDbGUvSSqgj6D5cwhJ8BjfUIRPbJz3CxL64KmsNXezEaMY60w=
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ lint-minimal:
python -m flake8 --ignore=F401,F841,F811 --select=F --exclude=todo,experimental,ethash.py,ethash_utils.py ethereum

test:
py.test --tb=no ethereum/tests/
py.test ethereum/tests/

test-passing:
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

test-failing:
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
test-todo:
py.test --continue-on-collection-errors ethereum/todo_tests

testnovm:
py.test --tb=no ethereum/tests/ --ignore=ethereum/tests/test_vm.py
Expand Down
4 changes: 2 additions & 2 deletions ethereum/pow/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def get_tx_position(self, tx):
def get_transaction(self, tx):
print('Deprecated. Use get_tx_position')
blknum, index = self.get_tx_position(tx)
blk = self.get_block_by_number(blknum)
blk = self.get_block_by_number(blknum)
return blk.transactions[index], blk, index

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

header = block.header
hashes = []
for i in xrange(max):
for i in range(max):
hash = header.prevhash
block = self.get_block(hash)
if block is None:
Expand Down
7 changes: 6 additions & 1 deletion ethereum/slogging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import json
import sys
import textwrap
from json.encoder import JSONEncoder
from logging import StreamHandler, Formatter, FileHandler
Expand Down Expand Up @@ -256,11 +257,15 @@ def getLogger(self, name):


def _stringify_dict_keys(input_):
if sys.version_info.major == 2:
longType = long # NOQA
else:
longType = int
if isinstance(input_, dict):
res = {}
for k, v in input_.items():
v = _stringify_dict_keys(v)
if not isinstance(k, (int, long, bool, None.__class__)):
if not isinstance(k, (int, longType, bool, None.__class__)):
k = str(k)
res[k] = v
elif isinstance(input_, (list, tuple)):
Expand Down
6 changes: 3 additions & 3 deletions ethereum/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
SECP256K1P = 2**256 - 4294968273

if sys.version_info.major == 2:
is_numeric = lambda x: isinstance(x, (int, long))
is_string = lambda x: isinstance(x, (str, unicode))
is_numeric = lambda x: isinstance(x, (int, long)) # NOQA
is_string = lambda x: isinstance(x, (str, unicode)) # NOQA

def to_string(value):
return str(value)
Expand All @@ -42,7 +42,7 @@ def int_to_bytes(value):

def to_string_for_regexp(value):
return str(value)
unicode = unicode
unicode = unicode # NOQA

def bytearray_to_bytestr(value):
return bytes(''.join(chr(c) for c in value))
Expand Down

0 comments on commit b052745

Please sign in to comment.