Skip to content

Commit 2cf553f

Browse files
author
Emmanouil Konstantinidis
committed
Fix tests
1 parent 7c0e1d9 commit 2cf553f

File tree

5 files changed

+21
-33
lines changed

5 files changed

+21
-33
lines changed

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
click==6.4
22
flake8==2.5.4
3-
nose==1.3.7
4-
coverage==4.0.3
3+
nose2==0.6.4
4+
cov-core==1.15.0
55
requests==2.9.1
66
httpretty==0.8.14
77
semantic-version==2.5.0

requirements/requirements-demo.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Django==1.9.4
2-
click==6.3
3-
djangorestframework==3.3.3
1+
Django==1.7.1
2+
click==6.1
3+
djangorestframework==3.3.2
44
django-crispy-forms==1.4.0
5-
drfdocs==0.0.9
6-
apscheduler==3.0.5
5+
drfdocs==0.0.5
6+
apscheduler==3.0.3
77

88
# commented-package==1.2.3
99
testing-errors-abc==0.0.12

runtests.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55

66
FLAKE8_ARGS = ['pypiup/', 'tests/', '--ignore=E501']
7-
COVERAGE_ARGS = ['--source=pypiup', '--omit=pypiup/__init__.py', 'nosetests', '-v']
7+
NOSE2_ARGS = [
8+
'--with-coverage',
9+
'--coverage', 'pypiup',
10+
'--coverage-report', 'term-missing',
11+
'--coverage-report', 'html',
12+
'--verbose'
13+
]
814

915

1016
def exit_on_failure(command, message=None):
@@ -13,32 +19,16 @@ def exit_on_failure(command, message=None):
1319

1420

1521
def flake8_main(args):
16-
print('Running: flake8', FLAKE8_ARGS)
22+
print('Running: flake8 %s' % FLAKE8_ARGS)
1723
command = subprocess.call(['flake8'] + args)
18-
print("" if command else "Success. flake8 passed.")
24+
print("" if command else "Success. flake8 passed.\n")
1925
return command
2026

2127

2228
def run_tests(args):
23-
print('Running: coverage run %s' % " ".join(COVERAGE_ARGS))
24-
command = subprocess.call(['coverage', 'run'] + args, shell=True)
29+
print('Running: nose2 -v %s' % " ".join(args))
30+
command = subprocess.call(['nose2'] + args)
2531
return command
2632

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-
4133
exit_on_failure(flake8_main(FLAKE8_ARGS))
42-
exit_on_failure(run_tests(COVERAGE_ARGS))
43-
exit_on_failure(run_coverage_report())
44-
exit_on_failure(run_coverage_html())
34+
exit_on_failure(run_tests(NOSE2_ARGS))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ def test_cli_file_not_found(self):
7676
self.assertEqual(result.exit_code, 0)
7777
self.assertIn("Could not find requirements-fake.txt. No such file or directory.", result.output)
7878

79-
if __name__ == '__main__':
80-
unittest.main()
79+
# if __name__ == '__main__':
80+
# unittest.main()

tox.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ setenv =
77
deps =
88
-rrequirements.txt
99
commands =
10-
pwd
11-
ls -la
1210
python runtests.py

0 commit comments

Comments
 (0)