File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -115,24 +115,25 @@ def get_suite(filenames):
115115
116116try :
117117 import coverage
118+ cov = coverage .Coverage ()
118119except ImportError :
119- coverage = None
120+ cov = None
120121
121- if coverage is not None :
122- coverage .erase ()
123- coverage .start ()
122+ if cov is not None :
123+ cov .erase ()
124+ cov .start ()
124125
125126result = runner .run (suite )
126127
127128if not result .wasSuccessful ():
128129 sys .exit (1 )
129130
130- if coverage is not None :
131- coverage .stop ()
132- coverage .report (coverage_modules )
133- coverage .erase ()
131+ if cov is not None :
132+ cov .stop ()
133+ cov .report (coverage_modules )
134+ cov .erase ()
134135
135- if coverage is None :
136+ if cov is None :
136137 sys .stderr .write ("""
137138No coverage reporting done (Python module "coverage" is missing)
138139Please install the python-coverage package to get coverage reporting.
You can’t perform that action at this time.
0 commit comments