diff --git a/.travis.sh b/.travis.sh new file mode 100755 index 00000000..ab95ebbc --- /dev/null +++ b/.travis.sh @@ -0,0 +1,10 @@ +#! /usr/bin/env bash +set -xe +if [ $TOX_ENV == "coverage" ] +then + pip install coveralls + tox -e py27 + coveralls +else + tox -e $TOX_ENV +fi diff --git a/.travis.yml b/.travis.yml index 301f7689..158770ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,16 @@ language: python - -python: - - "2.6" - - "2.7" - - "3.3" - - "3.4" - +python: "2.7" +env: +- TOX_ENV=py26 +- TOX_ENV=py27 +- TOX_ENV=py33 +- TOX_ENV=py34 +- TOX_ENV=flake8 +- TOX_ENV=docs +- TOX_ENV=coverage install: - - pip install -r requirements.txt - - pip install coverage==3.6 - - pip install python-coveralls==2.4.0 - - export PYTHONPATH=. - -before_script: coverage erase - -script: ./runtests - -after_success: coverage report; coveralls +- pip install tox +script: "./.travis.sh" +matrix: + allow_failures: + - env: TOXENV=coverage diff --git a/requirements.txt b/requirements.txt index 38f7c8bf..8d4a9a7c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,4 @@ Jinja2==2.7.1 Markdown==2.3.1 PyYAML==3.10 watchdog==0.7.0 -coverage==3.7.1 -flake8==2.1.0 ghp-import==0.4.1 diff --git a/runtests b/runtests deleted file mode 100755 index 4be83c64..00000000 --- a/runtests +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e - -coverage run --source=mkdocs mkdocs/test.py $@ -flake8 mkdocs --ignore=E128,E501 --exclude=__init__.py,compat.py -echo -coverage report diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..9e8ef9b6 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +coverage +flake8 +nose diff --git a/tox.ini b/tox.ini index a109aff8..9b2dbcba 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,16 @@ [tox] -envlist = py26,py27,py33,py34,docs +envlist = py26,py27,py33,py34,docs,flake8 [testenv] -deps=-rrequirements.txt -commands=./runtests +deps= + -rrequirements.txt + -rtest-requirements.txt +commands= + {envbindir}/nosetests --with-coverage --cover-package mkdocs --cover-html --cover-html-dir {envtmpdir}/coverage mkdocs/test.py [testenv:docs] commands={envbindir}/mkdocs build + +[testenv:flake8] +deps=-rtest-requirements.txt +commands={envbindir}/flake8 mkdocs --ignore=E128,E501 --exclude=__init__.py,compat.py