##// END OF EJS Templates
Make it possible to run the tests from the source dir without installation....
Fernando Perez -
Show More
@@ -0,0 +1,17 b''
1 #!/usr/bin/env python
2 """Test script for IPython.
3
4 The actual ipython test script to be installed with 'python setup.py install'
5 is in './scripts' directory. This file is here (ipython source root directory)
6 to facilitate non-root 'zero-installation testing' (just copy the source tree
7 somewhere and run ipython.py) and development.
8
9 You can run this script directly, type -h to see all options."""
10
11 # Ensure that the imported IPython is the local one, not a system-wide one
12 import os, sys
13 this_dir = os.path.dirname(os.path.abspath(__file__))
14 sys.path.insert(0, this_dir)
15
16 # Now proceed with execution
17 execfile(os.path.join(this_dir, 'IPython', 'scripts', 'iptest'))
@@ -30,6 +30,17 b' import tempfile'
30 import time
30 import time
31 import warnings
31 import warnings
32
32
33
34 # Ugly, but necessary hack to ensure the test suite finds our version of
35 # IPython and not a possibly different one that may exist system-wide.
36 # Note that this must be done here, so the imports that come next work
37 # correctly even if IPython isn't installed yet.
38 p = os.path
39 ippath = p.abspath(p.join(p.dirname(__file__),'..','..'))
40 sys.path.insert(0, ippath)
41 #print 'ipp:', ippath # dbg
42 #import IPython; print 'IP file:', IPython.__file__ # dbg
43
33 # Note: monkeypatch!
44 # Note: monkeypatch!
34 # We need to monkeypatch a small problem in nose itself first, before importing
45 # We need to monkeypatch a small problem in nose itself first, before importing
35 # it for actual use. This should get into nose upstream, but its release cycle
46 # it for actual use. This should get into nose upstream, but its release cycle
@@ -101,6 +112,10 b' def make_exclude():'
101
112
102 exclusions = [ipjoin('external'),
113 exclusions = [ipjoin('external'),
103 ipjoin('frontend', 'process', 'winprocess.py'),
114 ipjoin('frontend', 'process', 'winprocess.py'),
115 # Deprecated old Shell and iplib modules, skip to avoid
116 # warnings
117 ipjoin('Shell'),
118 ipjoin('iplib'),
104 pjoin('IPython_doctest_plugin'),
119 pjoin('IPython_doctest_plugin'),
105 ipjoin('quarantine'),
120 ipjoin('quarantine'),
106 ipjoin('deathrow'),
121 ipjoin('deathrow'),
@@ -193,7 +208,8 b' class IPTester(object):'
193 # Find our own 'iptest' script OS-level entry point. Don't look
208 # Find our own 'iptest' script OS-level entry point. Don't look
194 # system-wide, so we are sure we pick up *this one*. And pass
209 # system-wide, so we are sure we pick up *this one*. And pass
195 # through to subprocess call our own sys.argv
210 # through to subprocess call our own sys.argv
196 self.runner = tools.cmd2argv(__file__) + sys.argv[1:]
211 self.runner = tools.cmd2argv(os.path.abspath(__file__)) + \
212 sys.argv[1:]
197 else:
213 else:
198 self.runner = tools.cmd2argv(os.path.abspath(find_cmd('trial')))
214 self.runner = tools.cmd2argv(os.path.abspath(find_cmd('trial')))
199 if params is None:
215 if params is None:
@@ -388,8 +404,10 b' def run_iptestall():'
388 def main():
404 def main():
389 for arg in sys.argv[1:]:
405 for arg in sys.argv[1:]:
390 if arg.startswith('IPython'):
406 if arg.startswith('IPython'):
407 # This is in-process
391 run_iptest()
408 run_iptest()
392 else:
409 else:
410 # This starts subprocesses
393 run_iptestall()
411 run_iptestall()
394
412
395
413
@@ -244,13 +244,15 b' def ipexec(fname, options=None):'
244
244
245 _ip = get_ipython()
245 _ip = get_ipython()
246 test_dir = os.path.dirname(__file__)
246 test_dir = os.path.dirname(__file__)
247
247 # Find the ipython script from the package we're using, so that the test
248 # Find the ipython script from the package we're using, so that the test
248 # suite can be run from the source tree without an installed IPython
249 # suite can be run from the source tree without an installed IPython
249 ipython_package_dir = genutils.get_ipython_package_dir()
250 p = os.path
250 ipython_script = os.path.join(ipython_package_dir,'scripts','ipython')
251 ippath = p.abspath(p.join(p.dirname(__file__),'..','..'))
252 ipython_script = p.join(ippath, 'ipython.py')
251 ipython_cmd = 'python "%s"' % ipython_script
253 ipython_cmd = 'python "%s"' % ipython_script
252 # Absolute path for filename
254 # Absolute path for filename
253 full_fname = os.path.join(test_dir, fname)
255 full_fname = p.join(test_dir, fname)
254 full_cmd = '%s %s "%s"' % (ipython_cmd, cmdargs, full_fname)
256 full_cmd = '%s %s "%s"' % (ipython_cmd, cmdargs, full_fname)
255 return genutils.getoutputerror(full_cmd)
257 return genutils.getoutputerror(full_cmd)
256
258
@@ -5,7 +5,25 b' IPython README'
5 Overview
5 Overview
6 ========
6 ========
7
7
8 Welcome to IPython. Our documentation can be found in the docs/source
8 Welcome to IPython. Our full documentation can be found in the ``docs/dist``
9 subdirectory. We also have ``.html`` and ``.pdf`` versions of this
9 subdirectory in ``.html`` and ``.pdf`` formats, also available online at our
10 documentation available on the IPython `website <http://ipython.scipy.org>`_.
10 `website <http://ipython.scipy.org>`_. The ``docs/source`` directory contains
11 the plaintext version of these manuals.
11
12
13
14 Instant running and testing
15 ===========================
16
17 You can run IPython from this directory without even installing it system-wide
18 by typing at the terminal:
19
20 .. code-block:: bash
21
22 python ipython.py
23
24 and similarly, you can execute the built-in test suite with:
25
26 .. code-block:: bash
27
28 python iptest.py
29 No newline at end of file
@@ -42,7 +42,22 b' manages the Twisted reactor correctly.'
42 For the impatient: running the tests
42 For the impatient: running the tests
43 ====================================
43 ====================================
44
44
45 The simplest way to test IPython is to type at the command line:
45 You can run IPython from the source download directory without even installing
46 it system-wide or having configure anything, by typing at the terminal:
47
48 .. code-block:: bash
49
50 python ipython.py
51
52 and similarly, you can execute the built-in test suite with:
53
54 .. code-block:: bash
55
56 python iptest.py
57
58
59 Once you have either installed it or at least configured your system to be
60 able to import IPython, you can run the tests with:
46
61
47 .. code-block:: bash
62 .. code-block:: bash
48
63
@@ -50,7 +65,9 b' The simplest way to test IPython is to type at the command line:'
50
65
51 This should work as long as IPython can be imported, even if you haven't fully
66 This should work as long as IPython can be imported, even if you haven't fully
52 installed the user-facing scripts yet (common in a development environment).
67 installed the user-facing scripts yet (common in a development environment).
53 After a lot of output, you should see something like:
68
69
70 Regardless of how you run things, you should eventually see something like:
54
71
55 .. code-block:: bash
72 .. code-block:: bash
56
73
@@ -7,6 +7,10 b" in './scripts' directory. This file is here (ipython source root directory)"
7 to facilitate non-root 'zero-installation' (just copy the source tree
7 to facilitate non-root 'zero-installation' (just copy the source tree
8 somewhere and run ipython.py) and development. """
8 somewhere and run ipython.py) and development. """
9
9
10 from IPython.core.ipapp import launch_new_instance
10 # Ensure that the imported IPython is the local one, not a system-wide one
11 import os, sys
12 this_dir = os.path.dirname(os.path.abspath(__file__))
13 sys.path.insert(0, this_dir)
11
14
12 launch_new_instance()
15 # Now proceed with execution
16 execfile(os.path.join(this_dir, 'IPython', 'scripts', 'ipython'))
General Comments 0
You need to be logged in to leave comments. Login now