Skip to content

Commit

Permalink
Use nose, remove python 3.5 from tox
Browse files Browse the repository at this point in the history
See travis-ci/travis-ci#4794 for more info
  • Loading branch information
Emmanouil Konstantinidis committed Apr 1, 2016
1 parent 6ddaa12 commit 7c0e1d9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,6 @@ sudo: false
env:
- TOX_ENV=py27
- TOX_ENV=py34
- TOX_ENV=py35

matrix:
fast_finish: true
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
@@ -1,5 +1,6 @@
click==6.4
flake8==2.5.4
nose==1.3.7
coverage==4.0.3
requests==2.9.1
httpretty==0.8.14
Expand Down
26 changes: 21 additions & 5 deletions runtests.py
Expand Up @@ -4,7 +4,7 @@


FLAKE8_ARGS = ['pypiup/', 'tests/', '--ignore=E501']
COVERAGE_ARGS = ['--source=pypiup', '--omit=pypiup/__init__.py', 'python -m unittest -v tests/tests.py']
COVERAGE_ARGS = ['--source=pypiup', '--omit=pypiup/__init__.py', 'nosetests', '-v']


def exit_on_failure(command, message=None):
Expand All @@ -19,10 +19,26 @@ def flake8_main(args):
return command


def run_tests_coverage(args):
command = subprocess.call('coverage run --source=pypiup --omit=pypiup/__init__.py -m unittest tests.tests_cli', shell=True)
command = subprocess.call(['coverage', 'report'])
def run_tests(args):
print('Running: coverage run %s' % " ".join(COVERAGE_ARGS))
command = subprocess.call(['coverage', 'run'] + args, shell=True)
return command


def run_coverage_report():
print("\nCoverage Report:")
command = subprocess.call(['coverage', 'report', '-m'])
return command


def run_coverage_html():
print("\nGenerating Coverage HTML.")
command = subprocess.call(['coverage', 'html'])
print("Coverage HTML generated.")
return command


exit_on_failure(flake8_main(FLAKE8_ARGS))
exit_on_failure(run_tests_coverage(COVERAGE_ARGS))
exit_on_failure(run_tests(COVERAGE_ARGS))
exit_on_failure(run_coverage_report())
exit_on_failure(run_coverage_html())

0 comments on commit 7c0e1d9

Please sign in to comment.