44
55
66FLAKE8_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
1010def 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 ("\n Coverage Report:" )
30+ command = subprocess .call (['coverage' , 'report' , '-m' ])
31+ return command
32+
33+
34+ def run_coverage_html ():
35+ print ("\n Generating Coverage HTML." )
36+ command = subprocess .call (['coverage' , 'html' ])
37+ print ("Coverage HTML generated." )
38+ return command
39+
40+
2741exit_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