diff --git a/.travis.yml b/.travis.yml index c47988be8..360482c5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: python -python: 2.7 +python: 3.5 sudo: required dist: trusty env: - #matrix: - #- TOX_ENV=py27 - #- TOX_ENV=py34 - #- TOX_ENV=py35 + matrix: + - TOX_ENV=py27 + - TOX_ENV=py34 + - TOX_ENV=py35 global: - COVERAGE_APPEND="--append" - secure: cKbIgpTJ1yjKLBxpCEiT6IH7NShDWZUE+BvnrAfc+ujCsR6LyLJcKxFQmKnWryJCqg7fp82Ep2bF2oDKzanAROar2xDY1SFGbai42seYMaFCw53YPGJ6u3VNCcfT0rN9BWgE7el/m4fjcD6CRsZYKArNNJbMX8csRt3uXXCFLso= @@ -30,15 +30,13 @@ 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 - #- 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 -- ethereum/tests/test_vm.py - #- tox -e $TOX_ENV -- ethereum/tests/test_state.py - #- coverage report --show-missing + - if [ -d .tox/$TOX_ENV/ ]; then cd .tox/$TOX_ENV && coverage erase; fi; + - tox -e $TOX_ENV -- --ignore ethereum/todo_tests + - coverage report --show-missing after_success: - travis_retry pip install coveralls - cd .tox/$TOX_ENV && coveralls diff --git a/Makefile b/Makefile index c1722ea76..21edb2a50 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/ethereum/pow/chain.py b/ethereum/pow/chain.py index b74c9d44a..d5b1a4919 100644 --- a/ethereum/pow/chain.py +++ b/ethereum/pow/chain.py @@ -509,7 +509,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: diff --git a/ethereum/slogging.py b/ethereum/slogging.py index cad5131aa..05c7656c4 100644 --- a/ethereum/slogging.py +++ b/ethereum/slogging.py @@ -1,5 +1,6 @@ import logging import json +import sys import textwrap from json.encoder import JSONEncoder from logging import StreamHandler, Formatter, FileHandler @@ -262,11 +263,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)): diff --git a/ethereum/utils.py b/ethereum/utils.py index 69867ca0c..e9750966e 100644 --- a/ethereum/utils.py +++ b/ethereum/utils.py @@ -35,9 +35,8 @@ def int_to_big_endian(x): return big_endian_int.serialize(x) SECP256K1P = 2**256 - 4294968273 if sys.version_info.major == 2: - def is_numeric(x): return isinstance(x, (int, long)) - - def is_string(x): return 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) @@ -49,7 +48,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))