##// END OF EJS Templates
Merging upstream changes.
Brian Granger -
r2086:1be452ef merge
parent child Browse files
Show More
@@ -2,7 +2,7 b''
2 2
3 3 import curses, fcntl, signal, struct, tty, textwrap, inspect
4 4
5 from IPython.coreZ import ipapi
5 from IPython.core import ipapi
6 6
7 7 import astyle, ipipe
8 8
@@ -55,6 +55,11 b" have_twisted = test_for('twisted')"
55 55 have_foolscap = test_for('foolscap')
56 56 have_objc = test_for('objc')
57 57 have_pexpect = test_for('pexpect')
58 have_gtk = test_for('gtk')
59 have_gobject = test_for('gobject')
60
61
62 def make_exclude():
58 63
59 64 # For the IPythonDoctest plugin, we need to exclude certain patterns that cause
60 65 # testing problems. We should strive to minimize the number of skipped
@@ -63,22 +68,25 b" have_pexpect = test_for('pexpect')"
63 68 EXCLUDE = [pjoin('IPython', 'external'),
64 69 pjoin('IPython', 'frontend', 'process', 'winprocess.py'),
65 70 pjoin('IPython_doctest_plugin'),
66 pjoin('IPython', 'Gnuplot'),
67 71 pjoin('IPython', 'extensions', 'ipy_'),
68 72 pjoin('IPython', 'extensions', 'clearcmd'),
69 73 pjoin('IPython', 'extensions', 'PhysicalQInteractive'),
70 74 pjoin('IPython', 'extensions', 'scitedirector'),
71 75 pjoin('IPython', 'extensions', 'numeric_formats'),
72 76 pjoin('IPython', 'testing', 'attic'),
73 pjoin('IPython', 'testing', 'tutils'),
74 77 pjoin('IPython', 'testing', 'tools'),
75 pjoin('IPython', 'testing', 'mkdoctests')
78 pjoin('IPython', 'testing', 'mkdoctests'),
79 pjoin('IPython', 'lib', 'inputhook')
76 80 ]
77 81
78 82 if not have_wx:
79 83 EXCLUDE.append(pjoin('IPython', 'extensions', 'igrid'))
80 84 EXCLUDE.append(pjoin('IPython', 'gui'))
81 85 EXCLUDE.append(pjoin('IPython', 'frontend', 'wx'))
86 EXCLUDE.append(pjoin('IPython', 'lib', 'inputhookwx'))
87
88 if not have_gtk or not have_gobject:
89 EXCLUDE.append(pjoin('IPython', 'lib', 'inputhookgtk'))
82 90
83 91 if not have_objc:
84 92 EXCLUDE.append(pjoin('IPython', 'frontend', 'cocoa'))
@@ -87,7 +95,7 b' if not have_curses:'
87 95 EXCLUDE.append(pjoin('IPython', 'extensions', 'ibrowse'))
88 96
89 97 if not sys.platform == 'win32':
90 EXCLUDE.append(pjoin('IPython', 'platutils_win32'))
98 EXCLUDE.append(pjoin('IPython', 'utils', 'platutils_win32'))
91 99
92 100 # These have to be skipped on win32 because the use echo, rm, cd, etc.
93 101 # See ticket https://bugs.launchpad.net/bugs/366982
@@ -96,15 +104,19 b" if sys.platform == 'win32':"
96 104 EXCLUDE.append(pjoin('IPython', 'testing', 'plugin', 'dtexample'))
97 105
98 106 if not os.name == 'posix':
99 EXCLUDE.append(pjoin('IPython', 'platutils_posix'))
107 EXCLUDE.append(pjoin('IPython', 'utils', 'platutils_posix'))
100 108
101 109 if not have_pexpect:
102 EXCLUDE.append(pjoin('IPython', 'lib', 'irunner'))
110 EXCLUDE.append(pjoin('IPython', 'scripts', 'irunner'))
111
112 # Skip shell always because of a bug in FakeModule.
113 EXCLUDE.append(pjoin('IPython', 'core', 'shell'))
103 114
104 115 # This is needed for the reg-exp to match on win32 in the ipdoctest plugin.
105 116 if sys.platform == 'win32':
106 117 EXCLUDE = [s.replace('\\','\\\\') for s in EXCLUDE]
107 118
119 return EXCLUDE
108 120
109 121 #-----------------------------------------------------------------------------
110 122 # Functions and classes
@@ -155,13 +167,12 b' def run_iptest():'
155 167
156 168 # Construct list of plugins, omitting the existing doctest plugin, which
157 169 # ours replaces (and extends).
170 EXCLUDE = make_exclude()
158 171 plugins = [IPythonDoctest(EXCLUDE)]
159 172 for p in nose.plugins.builtin.plugins:
160 173 plug = p()
161 174 if plug.name == 'doctest':
162 175 continue
163
164 #print '*** adding plugin:',plug.name # dbg
165 176 plugins.append(plug)
166 177
167 178 TestProgram(argv=argv,plugins=plugins)
@@ -191,55 +202,28 b' class IPTester(object):'
191 202
192 203
193 204 def make_runners():
194 """Define the modules and packages that need to be tested.
205 """Define the top-level packages that need to be tested.
195 206 """
196 207
197 # This omits additional top-level modules that should not be doctested.
198 # XXX: shell.py is also ommited because of a bug in the skip_doctest
199 # decorator. See ticket https://bugs.launchpad.net/bugs/366209
200 top_mod = \
201 ['backgroundjobs.py', 'coloransi.py', 'completer.py', 'configloader.py',
202 'crashhandler.py', 'debugger.py', 'deepreload.py', 'demo.py',
203 'DPyGetOpt.py', 'dtutils.py', 'excolors.py', 'fakemodule.py',
204 'generics.py', 'genutils.py', 'history.py', 'hooks.py', 'ipapi.py',
205 'iplib.py', 'ipmaker.py', 'ipstruct.py', 'Itpl.py',
206 'logger.py', 'macro.py', 'magic.py', 'oinspect.py',
207 'outputtrap.py', 'platutils.py', 'prefilter.py', 'prompts.py',
208 'PyColorize.py', 'release.py', 'rlineimpl.py', 'shadowns.py',
209 'shellglobals.py', 'strdispatch.py', 'twshell.py',
210 'ultratb.py', 'upgradedir.py', 'usage.py', 'wildcard.py',
211 # See note above for why this is skipped
212 # 'shell.py',
213 'winconsole.py']
214
215 if have_pexpect:
216 top_mod.append('irunner.py')
217
218 if sys.platform == 'win32':
219 top_mod.append('platutils_win32.py')
220 elif os.name == 'posix':
221 top_mod.append('platutils_posix.py')
222 else:
223 top_mod.append('platutils_dummy.py')
224
225 # These are tested by nose, so skip IPython.kernel
226 top_pack = ['config','extensions','frontend',
227 'testing','tests','tools','userconfig']
208 nose_packages = ['config', 'core', 'extensions',
209 'frontend', 'lib', 'quarantine',
210 'scripts', 'testing', 'utils']
211 trial_packages = ['kernel']
228 212
229 213 if have_wx:
230 top_pack.append('gui')
214 nose_packages.append('gui')
231 215
232 modules = ['IPython.%s' % m[:-3] for m in top_mod ]
233 packages = ['IPython.%s' % m for m in top_pack ]
216 nose_packages = ['IPython.%s' % m for m in nose_packages ]
217 trial_packages = ['IPython.%s' % m for m in trial_packages ]
234 218
235 219 # Make runners
236 runners = dict(zip(top_pack, [IPTester(params=v) for v in packages]))
220 runners = dict()
237 221
238 # Test IPython.kernel using trial if twisted is installed
222 nose_runners = dict(zip(nose_packages, [IPTester(params=v) for v in nose_packages]))
239 223 if have_zi and have_twisted and have_foolscap:
240 runners['trial'] = IPTester('trial',['IPython'])
241
242 runners['modules'] = IPTester(params=modules)
224 trial_runners = dict(zip(trial_packages, [IPTester('trial',params=v) for v in trial_packages]))
225 runners.update(nose_runners)
226 runners.update(trial_runners)
243 227
244 228 return runners
245 229
@@ -252,7 +236,9 b' def run_iptestall():'
252 236 and packages of IPython to be tested each in their own subprocess using
253 237 nose or twisted.trial appropriately.
254 238 """
239
255 240 runners = make_runners()
241
256 242 # Run all test runners, tracking execution time
257 243 failed = {}
258 244 t_start = time.time()
@@ -2178,7 +2178,7 b' def extract_vars(*names,**kw):'
2178 2178
2179 2179 In [2]: def func(x):
2180 2180 ...: y = 1
2181 ...: print extractVars('x','y')
2181 ...: print extract_vars('x','y')
2182 2182 ...:
2183 2183
2184 2184 In [3]: func('hello')
1 NO CONTENT: file renamed from setup_bdist_egg.py to tools/setup_bdist_egg.py
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now