Skip to content

Commit 7c0e1d9

Browse files
author
Emmanouil Konstantinidis
committed
Use nose, remove python 3.5 from tox
See travis-ci/travis-ci#4794 for more info
1 parent 6ddaa12 commit 7c0e1d9

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ sudo: false
55
env:
66
- TOX_ENV=py27
77
- TOX_ENV=py34
8-
- TOX_ENV=py35
98

109
matrix:
1110
fast_finish: true

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
click==6.4
22
flake8==2.5.4
3+
nose==1.3.7
34
coverage==4.0.3
45
requests==2.9.1
56
httpretty==0.8.14

runtests.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

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

99

1010
def exit_on_failure(command, message=None):
@@ -19,10 +19,26 @@ def flake8_main(args):
1919
return command
2020

2121

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

27+
28+
def run_coverage_report():
29+
print("\nCoverage Report:")
30+
command = subprocess.call(['coverage', 'report', '-m'])
31+
return command
32+
33+
34+
def run_coverage_html():
35+
print("\nGenerating Coverage HTML.")
36+
command = subprocess.call(['coverage', 'html'])
37+
print("Coverage HTML generated.")
38+
return command
39+
40+
2741
exit_on_failure(flake8_main(FLAKE8_ARGS))
28-
exit_on_failure(run_tests_coverage(COVERAGE_ARGS))
42+
exit_on_failure(run_tests(COVERAGE_ARGS))
43+
exit_on_failure(run_coverage_report())
44+
exit_on_failure(run_coverage_html())

0 commit comments

Comments
 (0)