##// END OF EJS Templates
add example of likely kwargs to test() docstring
Paul Ivanov -
Show More
@@ -1,32 +1,38 b''
1 """Testing support (tools to test IPython itself).
1 """Testing support (tools to test IPython itself).
2 """
2 """
3
3
4 #-----------------------------------------------------------------------------
4 #-----------------------------------------------------------------------------
5 # Copyright (C) 2009-2011 The IPython Development Team
5 # Copyright (C) 2009-2011 The IPython Development Team
6 #
6 #
7 # Distributed under the terms of the BSD License. The full license is in
7 # Distributed under the terms of the BSD License. The full license is in
8 # the file COPYING, distributed as part of this software.
8 # the file COPYING, distributed as part of this software.
9 #-----------------------------------------------------------------------------
9 #-----------------------------------------------------------------------------
10
10
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12 # Functions
12 # Functions
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14
15 # User-level entry point for testing
15 # User-level entry point for testing
16 def test(**kwargs):
16 def test(**kwargs):
17 """Run the entire IPython test suite.
17 """Run the entire IPython test suite.
18
18
19 Any of the options for run_iptestall() may be passed as keyword arguments.
19 Any of the options for run_iptestall() may be passed as keyword arguments.
20
21 For example:
22
23 IPython.test(testgroups=['lib', 'config', 'utils'], fast=2)
24
25 will run those three sections of the test suite, using two processes.
20 """
26 """
21
27
22 # Do the import internally, so that this function doesn't increase total
28 # Do the import internally, so that this function doesn't increase total
23 # import time
29 # import time
24 from .iptestcontroller import run_iptestall, default_options
30 from .iptestcontroller import run_iptestall, default_options
25 options = default_options()
31 options = default_options()
26 for name, val in kwargs.items():
32 for name, val in kwargs.items():
27 setattr(options, name, val)
33 setattr(options, name, val)
28 run_iptestall(options)
34 run_iptestall(options)
29
35
30 # So nose doesn't try to run this as a test itself and we end up with an
36 # So nose doesn't try to run this as a test itself and we end up with an
31 # infinite test loop
37 # infinite test loop
32 test.__test__ = False
38 test.__test__ = False
General Comments 0
You need to be logged in to leave comments. Login now