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+ NOSE2_ARGS = [
8+ '--with-coverage' ,
9+ '--coverage' , 'pypiup' ,
10+ '--coverage-report' , 'term-missing' ,
11+ '--coverage-report' , 'html' ,
12+ '--verbose'
13+ ]
814
915
1016def exit_on_failure (command , message = None ):
@@ -13,16 +19,16 @@ def exit_on_failure(command, message=None):
1319
1420
1521def 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
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' ] )
28+ def run_tests (args ):
29+ print ( 'Running: nose2 -v %s' % " " . join ( args ) )
30+ command = subprocess .call (['nose2' ] + args )
2531 return command
2632
2733exit_on_failure (flake8_main (FLAKE8_ARGS ))
28- exit_on_failure (run_tests_coverage ( COVERAGE_ARGS ))
34+ exit_on_failure (run_tests ( NOSE2_ARGS ))
0 commit comments