##// END OF EJS Templates
Make testing easier by exposing a top-level test() function....
Fernando Perez -
Show More
@@ -1,64 +1,64 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 # encoding: utf-8
2 # encoding: utf-8
3 """
3 """
4 IPython.
4 IPython.
5
5
6 IPython is a set of tools for interactive and exploratory computing in Python.
6 IPython is a set of tools for interactive and exploratory computing in Python.
7 """
7 """
8
8
9 #-----------------------------------------------------------------------------
9 #-----------------------------------------------------------------------------
10 # Copyright (C) 2008-2009 The IPython Development Team
10 # Copyright (C) 2008-2009 The IPython Development Team
11 #
11 #
12 # Distributed under the terms of the BSD License. The full license is in
12 # Distributed under the terms of the BSD License. The full license is in
13 # the file COPYING, distributed as part of this software.
13 # the file COPYING, distributed as part of this software.
14 #-----------------------------------------------------------------------------
14 #-----------------------------------------------------------------------------
15
15
16 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17 # Imports
17 # Imports
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19
19
20 import os
20 import os
21 import sys
21 import sys
22 from IPython.core import release
22 from IPython.core import release
23
23
24 #-----------------------------------------------------------------------------
24 #-----------------------------------------------------------------------------
25 # Setup everything
25 # Setup everything
26 #-----------------------------------------------------------------------------
26 #-----------------------------------------------------------------------------
27
27
28
28
29 if sys.version[0:3] < '2.4':
29 if sys.version[0:3] < '2.4':
30 raise ImportError('Python Version 2.4 or above is required for IPython.')
30 raise ImportError('Python Version 2.4 or above is required for IPython.')
31
31
32
32
33 # Make it easy to import extensions - they are always directly on pythonpath.
33 # Make it easy to import extensions - they are always directly on pythonpath.
34 # Therefore, non-IPython modules can be added to extensions directory
34 # Therefore, non-IPython modules can be added to extensions directory
35 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
35 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
36
36
37 #-----------------------------------------------------------------------------
37 #-----------------------------------------------------------------------------
38 # Setup the top level names
38 # Setup the top level names
39 #-----------------------------------------------------------------------------
39 #-----------------------------------------------------------------------------
40
40
41 # In some cases, these are causing circular imports.
41 # In some cases, these are causing circular imports.
42 from IPython.core.iplib import InteractiveShell
42 from IPython.core.iplib import InteractiveShell
43 from IPython.core.embed import embed
43 from IPython.core.embed import embed
44 from IPython.core.error import TryNext
44 from IPython.core.error import TryNext
45 from IPython.testing import test
45
46
46 from IPython.lib import (
47 from IPython.lib import (
47 enable_wx, disable_wx,
48 enable_wx, disable_wx,
48 enable_gtk, disable_gtk,
49 enable_gtk, disable_gtk,
49 enable_qt4, disable_qt4,
50 enable_qt4, disable_qt4,
50 enable_tk, disable_tk,
51 enable_tk, disable_tk,
51 set_inputhook, clear_inputhook,
52 set_inputhook, clear_inputhook,
52 current_gui, spin,
53 current_gui, spin,
53 appstart_qt4, appstart_wx,
54 appstart_qt4, appstart_wx,
54 appstart_gtk, appstart_tk
55 appstart_gtk, appstart_tk
55 )
56 )
56
57
57 # Release data
58 # Release data
58 __author__ = ''
59 __author__ = ''
59 for author, email in release.authors.values():
60 for author, email in release.authors.values():
60 __author__ += author + ' <' + email + '>\n'
61 __author__ += author + ' <' + email + '>\n'
61 __license__ = release.license
62 __license__ = release.license
62 __version__ = release.version
63 __version__ = release.version
63 __revision__ = release.revision
64 __revision__ = release.revision
64
@@ -0,0 +1,18 b''
1 """Testing support (tools to test IPython itself).
2 """
3
4 # User-level entry point for testing
5 def test():
6 """Run the entire IPython test suite.
7
8 For fine-grained control, you should use the :file:`iptest` script supplied
9 with the IPython installation."""
10
11 # Do the import internally, so that this function doesn't increase total
12 # import time
13 from iptest import run_iptestall
14 run_iptestall()
15
16 # So nose doesn't try to run this as a test itself and we end up with an
17 # infinite test loop
18 test.__test__ = False
General Comments 0
You need to be logged in to leave comments. Login now