##// 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 import curses, fcntl, signal, struct, tty, textwrap, inspect
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 import astyle, ipipe
7 import astyle, ipipe
8
8
@@ -55,56 +55,68 b" have_twisted = test_for('twisted')"
55 have_foolscap = test_for('foolscap')
55 have_foolscap = test_for('foolscap')
56 have_objc = test_for('objc')
56 have_objc = test_for('objc')
57 have_pexpect = test_for('pexpect')
57 have_pexpect = test_for('pexpect')
58 have_gtk = test_for('gtk')
59 have_gobject = test_for('gobject')
60
61
62 def make_exclude():
63
64 # For the IPythonDoctest plugin, we need to exclude certain patterns that cause
65 # testing problems. We should strive to minimize the number of skipped
66 # modules, since this means untested code. As the testing machinery
67 # solidifies, this list should eventually become empty.
68 EXCLUDE = [pjoin('IPython', 'external'),
69 pjoin('IPython', 'frontend', 'process', 'winprocess.py'),
70 pjoin('IPython_doctest_plugin'),
71 pjoin('IPython', 'extensions', 'ipy_'),
72 pjoin('IPython', 'extensions', 'clearcmd'),
73 pjoin('IPython', 'extensions', 'PhysicalQInteractive'),
74 pjoin('IPython', 'extensions', 'scitedirector'),
75 pjoin('IPython', 'extensions', 'numeric_formats'),
76 pjoin('IPython', 'testing', 'attic'),
77 pjoin('IPython', 'testing', 'tools'),
78 pjoin('IPython', 'testing', 'mkdoctests'),
79 pjoin('IPython', 'lib', 'inputhook')
80 ]
81
82 if not have_wx:
83 EXCLUDE.append(pjoin('IPython', 'extensions', 'igrid'))
84 EXCLUDE.append(pjoin('IPython', 'gui'))
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'))
90
91 if not have_objc:
92 EXCLUDE.append(pjoin('IPython', 'frontend', 'cocoa'))
93
94 if not have_curses:
95 EXCLUDE.append(pjoin('IPython', 'extensions', 'ibrowse'))
96
97 if not sys.platform == 'win32':
98 EXCLUDE.append(pjoin('IPython', 'utils', 'platutils_win32'))
99
100 # These have to be skipped on win32 because the use echo, rm, cd, etc.
101 # See ticket https://bugs.launchpad.net/bugs/366982
102 if sys.platform == 'win32':
103 EXCLUDE.append(pjoin('IPython', 'testing', 'plugin', 'test_exampleip'))
104 EXCLUDE.append(pjoin('IPython', 'testing', 'plugin', 'dtexample'))
105
106 if not os.name == 'posix':
107 EXCLUDE.append(pjoin('IPython', 'utils', 'platutils_posix'))
58
108
59 # For the IPythonDoctest plugin, we need to exclude certain patterns that cause
109 if not have_pexpect:
60 # testing problems. We should strive to minimize the number of skipped
110 EXCLUDE.append(pjoin('IPython', 'scripts', 'irunner'))
61 # modules, since this means untested code. As the testing machinery
62 # solidifies, this list should eventually become empty.
63 EXCLUDE = [pjoin('IPython', 'external'),
64 pjoin('IPython', 'frontend', 'process', 'winprocess.py'),
65 pjoin('IPython_doctest_plugin'),
66 pjoin('IPython', 'Gnuplot'),
67 pjoin('IPython', 'extensions', 'ipy_'),
68 pjoin('IPython', 'extensions', 'clearcmd'),
69 pjoin('IPython', 'extensions', 'PhysicalQInteractive'),
70 pjoin('IPython', 'extensions', 'scitedirector'),
71 pjoin('IPython', 'extensions', 'numeric_formats'),
72 pjoin('IPython', 'testing', 'attic'),
73 pjoin('IPython', 'testing', 'tutils'),
74 pjoin('IPython', 'testing', 'tools'),
75 pjoin('IPython', 'testing', 'mkdoctests')
76 ]
77
78 if not have_wx:
79 EXCLUDE.append(pjoin('IPython', 'extensions', 'igrid'))
80 EXCLUDE.append(pjoin('IPython', 'gui'))
81 EXCLUDE.append(pjoin('IPython', 'frontend', 'wx'))
82
83 if not have_objc:
84 EXCLUDE.append(pjoin('IPython', 'frontend', 'cocoa'))
85
86 if not have_curses:
87 EXCLUDE.append(pjoin('IPython', 'extensions', 'ibrowse'))
88
89 if not sys.platform == 'win32':
90 EXCLUDE.append(pjoin('IPython', 'platutils_win32'))
91
92 # These have to be skipped on win32 because the use echo, rm, cd, etc.
93 # See ticket https://bugs.launchpad.net/bugs/366982
94 if sys.platform == 'win32':
95 EXCLUDE.append(pjoin('IPython', 'testing', 'plugin', 'test_exampleip'))
96 EXCLUDE.append(pjoin('IPython', 'testing', 'plugin', 'dtexample'))
97
98 if not os.name == 'posix':
99 EXCLUDE.append(pjoin('IPython', 'platutils_posix'))
100
101 if not have_pexpect:
102 EXCLUDE.append(pjoin('IPython', 'lib', 'irunner'))
103
104 # This is needed for the reg-exp to match on win32 in the ipdoctest plugin.
105 if sys.platform == 'win32':
106 EXCLUDE = [s.replace('\\','\\\\') for s in EXCLUDE]
107
111
112 # Skip shell always because of a bug in FakeModule.
113 EXCLUDE.append(pjoin('IPython', 'core', 'shell'))
114
115 # This is needed for the reg-exp to match on win32 in the ipdoctest plugin.
116 if sys.platform == 'win32':
117 EXCLUDE = [s.replace('\\','\\\\') for s in EXCLUDE]
118
119 return EXCLUDE
108
120
109 #-----------------------------------------------------------------------------
121 #-----------------------------------------------------------------------------
110 # Functions and classes
122 # Functions and classes
@@ -155,13 +167,12 b' def run_iptest():'
155
167
156 # Construct list of plugins, omitting the existing doctest plugin, which
168 # Construct list of plugins, omitting the existing doctest plugin, which
157 # ours replaces (and extends).
169 # ours replaces (and extends).
170 EXCLUDE = make_exclude()
158 plugins = [IPythonDoctest(EXCLUDE)]
171 plugins = [IPythonDoctest(EXCLUDE)]
159 for p in nose.plugins.builtin.plugins:
172 for p in nose.plugins.builtin.plugins:
160 plug = p()
173 plug = p()
161 if plug.name == 'doctest':
174 if plug.name == 'doctest':
162 continue
175 continue
163
164 #print '*** adding plugin:',plug.name # dbg
165 plugins.append(plug)
176 plugins.append(plug)
166
177
167 TestProgram(argv=argv,plugins=plugins)
178 TestProgram(argv=argv,plugins=plugins)
@@ -191,55 +202,28 b' class IPTester(object):'
191
202
192
203
193 def make_runners():
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
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
207
218 if sys.platform == 'win32':
208 nose_packages = ['config', 'core', 'extensions',
219 top_mod.append('platutils_win32.py')
209 'frontend', 'lib', 'quarantine',
220 elif os.name == 'posix':
210 'scripts', 'testing', 'utils']
221 top_mod.append('platutils_posix.py')
211 trial_packages = ['kernel']
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']
228
212
229 if have_wx:
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 ]
216 nose_packages = ['IPython.%s' % m for m in nose_packages ]
233 packages = ['IPython.%s' % m for m in top_pack ]
217 trial_packages = ['IPython.%s' % m for m in trial_packages ]
234
218
235 # Make runners
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 if have_zi and have_twisted and have_foolscap:
223 if have_zi and have_twisted and have_foolscap:
240 runners['trial'] = IPTester('trial',['IPython'])
224 trial_runners = dict(zip(trial_packages, [IPTester('trial',params=v) for v in trial_packages]))
241
225 runners.update(nose_runners)
242 runners['modules'] = IPTester(params=modules)
226 runners.update(trial_runners)
243
227
244 return runners
228 return runners
245
229
@@ -252,13 +236,15 b' def run_iptestall():'
252 and packages of IPython to be tested each in their own subprocess using
236 and packages of IPython to be tested each in their own subprocess using
253 nose or twisted.trial appropriately.
237 nose or twisted.trial appropriately.
254 """
238 """
239
255 runners = make_runners()
240 runners = make_runners()
241
256 # Run all test runners, tracking execution time
242 # Run all test runners, tracking execution time
257 failed = {}
243 failed = {}
258 t_start = time.time()
244 t_start = time.time()
259 for name,runner in runners.iteritems():
245 for name,runner in runners.iteritems():
260 print '*'*77
246 print '*'*77
261 print 'IPython test set:',name
247 print 'IPython test set:', name
262 res = runner.run()
248 res = runner.run()
263 if res:
249 if res:
264 failed[name] = res
250 failed[name] = res
@@ -2178,7 +2178,7 b' def extract_vars(*names,**kw):'
2178
2178
2179 In [2]: def func(x):
2179 In [2]: def func(x):
2180 ...: y = 1
2180 ...: y = 1
2181 ...: print extractVars('x','y')
2181 ...: print extract_vars('x','y')
2182 ...:
2182 ...:
2183
2183
2184 In [3]: func('hello')
2184 In [3]: func('hello')
1 NO CONTENT: file renamed from setup_bdist_egg.py to tools/setup_bdist_egg.py
NO CONTENT: file renamed from setup_bdist_egg.py to tools/setup_bdist_egg.py
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now