File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ #
3
+ # This allows running the matplotlib tests from the command line: e.g.
4
+ #
5
+ # $ python tests.py -v -d
6
+ #
7
+ # The arguments are identical to the arguments accepted by nosetests.
8
+ #
9
+ # See https://nose.readthedocs.org/ for a detailed description of
10
+ # these options.
11
+
12
+ import os
13
+ import sys
14
+ import time
15
+
16
+ import matplotlib
17
+ matplotlib .use ('agg' )
18
+
19
+ import nose
20
+ from matplotlib .testing .noseclasses import KnownFailure
21
+ from matplotlib import default_test_modules
22
+
23
+ from matplotlib import font_manager
24
+ # Make sure the font caches are created before starting any possibly
25
+ # parallel tests
26
+ if font_manager ._fmcache is not None :
27
+ while not os .path .exists (font_manager ._fmcache ):
28
+ time .sleep (0.5 )
29
+
30
+ plugins = [KnownFailure ]
31
+
32
+ # Nose doesn't automatically instantiate all of the plugins in the
33
+ # child processes, so we have to provide the multiprocess plugin with
34
+ # a list.
35
+ from nose .plugins import multiprocess
36
+ multiprocess ._instantiate_plugins = plugins
37
+
38
+
39
+ def run ():
40
+ try :
41
+ import faulthandler
42
+ except ImportError :
43
+ pass
44
+ else :
45
+ faulthandler .enable ()
46
+
47
+ nose .main (addplugins = [x () for x in plugins ],
48
+ defaultTest = default_test_modules )
49
+
50
+ if __name__ == '__main__' :
51
+ if '--no-pep8' in sys .argv :
52
+ default_test_modules .remove ('matplotlib.tests.test_coding_standards' )
53
+ sys .argv .remove ('--no-pep8' )
54
+ elif '--pep8' in sys .argv :
55
+ default_test_modules = ['matplotlib.tests.test_coding_standards' ]
56
+ sys .argv .remove ('--pep8' )
57
+
58
+ run ()
You can’t perform that action at this time.
0 commit comments