44
55
66FLAKE8_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
1016def exit_on_failure (command , message = None ):
@@ -13,32 +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
2228def 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 ("\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-
4133exit_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 ))
0 commit comments