@@ -163,7 +163,7 @@ def finalize_options(self):
163
163
from distutils .errors import DistutilsOptionError
164
164
raise DistutilsOptionError (
165
165
"You are using several options for the test command in an "
166
- "incompatible manner. Please use either one of --pep8-only, "
166
+ "incompatible manner. Please use either --pep8-only or "
167
167
"--omit-pep8"
168
168
)
169
169
@@ -203,38 +203,35 @@ def run(self):
203
203
204
204
205
205
def run_tests (self ):
206
- try :
207
- import matplotlib
208
- matplotlib .use ('agg' )
209
- import nose
210
- from matplotlib .testing .noseclasses import KnownFailure
211
- from matplotlib import default_test_modules as testmodules
212
- from matplotlib import font_manager
213
- import time
214
- # Make sure the font caches are created before starting any possibly
215
- # parallel tests
216
- if font_manager ._fmcache is not None :
217
- while not os .path .exists (font_manager ._fmcache ):
218
- time .sleep (0.5 )
219
- plugins = [KnownFailure ]
220
-
221
- # Nose doesn't automatically instantiate all of the plugins in the
222
- # child processes, so we have to provide the multiprocess plugin
223
- # with a list.
224
- from nose .plugins import multiprocess
225
- multiprocess ._instantiate_plugins = plugins
226
-
227
- if self .omit_pep8 :
228
- testmodules .remove ('matplotlib.tests.test_coding_standards' )
229
- elif self .pep8_only :
230
- testmodules = ['matplotlib.tests.test_coding_standards' ]
231
-
232
- nose .main (addplugins = [x () for x in plugins ],
233
- defaultTest = testmodules ,
234
- argv = ['nosetests' ] + self .test_args ,
235
- exit = False )
236
- except ImportError :
237
- sys .exit (- 1 )
206
+ import matplotlib
207
+ matplotlib .use ('agg' )
208
+ import nose
209
+ from matplotlib .testing .noseclasses import KnownFailure
210
+ from matplotlib import default_test_modules as testmodules
211
+ from matplotlib import font_manager
212
+ import time
213
+ # Make sure the font caches are created before starting any possibly
214
+ # parallel tests
215
+ if font_manager ._fmcache is not None :
216
+ while not os .path .exists (font_manager ._fmcache ):
217
+ time .sleep (0.5 )
218
+ plugins = [KnownFailure ]
219
+
220
+ # Nose doesn't automatically instantiate all of the plugins in the
221
+ # child processes, so we have to provide the multiprocess plugin
222
+ # with a list.
223
+ from nose .plugins import multiprocess
224
+ multiprocess ._instantiate_plugins = plugins
225
+
226
+ if self .omit_pep8 :
227
+ testmodules .remove ('matplotlib.tests.test_coding_standards' )
228
+ elif self .pep8_only :
229
+ testmodules = ['matplotlib.tests.test_coding_standards' ]
230
+
231
+ nose .main (addplugins = [x () for x in plugins ],
232
+ defaultTest = testmodules ,
233
+ argv = ['nosetests' ] + self .test_args ,
234
+ exit = False )
238
235
239
236
240
237
# One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,
0 commit comments