diff --git a/.travis.yml b/.travis.yml index b29176b..0bae214 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,10 @@ +sudo: false language: python python: - - "2.7" -install: pip install -r requirements-dev.txt -script: python setup.py install && pytest tests/unit-tests.py -x -s -v + - 2.7 + - 3.7 +env: + - TOXENV=py-normal + +install: pip install tox +script: tox diff --git a/requirements-dev.txt b/requirements-dev.txt index f564b2a..f581892 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,3 +6,6 @@ pep8-naming autoflake mccabe yapf +tox +coverage +pytest-cov diff --git a/setup.cfg b/setup.cfg index be67302..b56a48d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,3 +26,17 @@ no_spaces_around_selected_binary_operators = false split_penalty_import_names = 500 join_multiple_lines = true +[coverage:run] +omit = + tests/* + src/* + setup.py + .tox/* + dist/* + **/celeryconfig.py + **/constants.py + **/migrations/* + **/__init__.py + app.py + **/env.py + **/urls.py diff --git a/tests/unit-tests.py b/tests/tests.py similarity index 97% rename from tests/unit-tests.py rename to tests/tests.py index cbdb2fc..41f6fe8 100644 --- a/tests/unit-tests.py +++ b/tests/tests.py @@ -9,9 +9,6 @@ import os from mega import Mega -email = os.environ['EMAIL'] -password = os.environ['PASS'] - mega = Mega() # anonymous login m = mega.login() diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..581e6f6 --- /dev/null +++ b/tox.ini @@ -0,0 +1,11 @@ +[tox] +envlist = py{27,37}-normal,lint + +[testenv] +commands = + flake8 {toxinidir}/src/ + coverage erase + PYTHONPATH=. pytest --cov=. {toxinidir}/tests/tests.py + +deps = + -rrequirements-dev.txt