##// END OF EJS Templates
Merge pull request #8248 from minrk/skip-doctest...
Thomas Kluyver -
r21135:a5173d1d merge
parent child Browse files
Show More
@@ -69,7 +69,6 b' except ImportError:'
69 from IPython.core.displaypub import publish_display_data
69 from IPython.core.displaypub import publish_display_data
70 from IPython.core.magic import (Magics, magics_class, line_magic,
70 from IPython.core.magic import (Magics, magics_class, line_magic,
71 line_cell_magic, needs_local_scope)
71 line_cell_magic, needs_local_scope)
72 from IPython.testing.skipdoctest import skip_doctest
73 from IPython.core.magic_arguments import (
72 from IPython.core.magic_arguments import (
74 argument, magic_arguments, parse_argstring
73 argument, magic_arguments, parse_argstring
75 )
74 )
@@ -234,7 +233,6 b' class RMagics(Magics):'
234 self.Rstdout_cache = []
233 self.Rstdout_cache = []
235 return value
234 return value
236
235
237 @skip_doctest
238 @needs_local_scope
236 @needs_local_scope
239 @line_magic
237 @line_magic
240 def Rpush(self, line, local_ns=None):
238 def Rpush(self, line, local_ns=None):
@@ -275,7 +273,6 b' class RMagics(Magics):'
275
273
276 self.r.assign(input, self.pyconverter(val))
274 self.r.assign(input, self.pyconverter(val))
277
275
278 @skip_doctest
279 @magic_arguments()
276 @magic_arguments()
280 @argument(
277 @argument(
281 '-d', '--as_dataframe', action='store_true',
278 '-d', '--as_dataframe', action='store_true',
@@ -327,7 +324,6 b' class RMagics(Magics):'
327 for output in outputs:
324 for output in outputs:
328 self.shell.push({output:self.Rconverter(self.r(output),dataframe=args.as_dataframe)})
325 self.shell.push({output:self.Rconverter(self.r(output),dataframe=args.as_dataframe)})
329
326
330 @skip_doctest
331 @magic_arguments()
327 @magic_arguments()
332 @argument(
328 @argument(
333 '-d', '--as_dataframe', action='store_true',
329 '-d', '--as_dataframe', action='store_true',
@@ -370,7 +366,6 b' class RMagics(Magics):'
370 return self.Rconverter(self.r(output[0]),dataframe=args.as_dataframe)
366 return self.Rconverter(self.r(output[0]),dataframe=args.as_dataframe)
371
367
372
368
373 @skip_doctest
374 @magic_arguments()
369 @magic_arguments()
375 @argument(
370 @argument(
376 '-i', '--input', action='append',
371 '-i', '--input', action='append',
@@ -28,7 +28,6 b' import inspect, os, sys, textwrap'
28 # Our own
28 # Our own
29 from IPython.core.error import UsageError
29 from IPython.core.error import UsageError
30 from IPython.core.magic import Magics, magics_class, line_magic
30 from IPython.core.magic import Magics, magics_class, line_magic
31 from IPython.testing.skipdoctest import skip_doctest
32 from IPython.utils.traitlets import Bool
31 from IPython.utils.traitlets import Bool
33 from IPython.utils.py3compat import string_types
32 from IPython.utils.py3compat import string_types
34
33
@@ -87,7 +86,6 b' class StoreMagics(Magics):'
87 if self.autorestore:
86 if self.autorestore:
88 restore_data(self.shell)
87 restore_data(self.shell)
89
88
90 @skip_doctest
91 @line_magic
89 @line_magic
92 def store(self, parameter_s=''):
90 def store(self, parameter_s=''):
93 """Lightweight persistence for python variables.
91 """Lightweight persistence for python variables.
@@ -7,7 +7,6 b' Propagate changes between widgets on the javascript side'
7 # Distributed under the terms of the Modified BSD License.
7 # Distributed under the terms of the Modified BSD License.
8
8
9 from .widget import Widget
9 from .widget import Widget
10 from IPython.testing.skipdoctest import skip_doctest
11 from IPython.utils.traitlets import Unicode, Tuple, List,Instance, TraitError
10 from IPython.utils.traitlets import Unicode, Tuple, List,Instance, TraitError
12
11
13 class WidgetTraitTuple(Tuple):
12 class WidgetTraitTuple(Tuple):
@@ -51,7 +50,6 b' class Link(Widget):'
51 self.close()
50 self.close()
52
51
53
52
54 @skip_doctest
55 def jslink(*args):
53 def jslink(*args):
56 """Link traits from different widgets together on the frontend so they remain in sync.
54 """Link traits from different widgets together on the frontend so they remain in sync.
57
55
@@ -92,7 +90,6 b' class DirectionalLink(Widget):'
92 def unlink(self):
90 def unlink(self):
93 self.close()
91 self.close()
94
92
95 @skip_doctest
96 def jsdlink(source, *targets):
93 def jsdlink(source, *targets):
97 """Link the trait of a source widget with traits of target widgets in the frontend.
94 """Link the trait of a source widget with traits of target widgets in the frontend.
98
95
@@ -10,10 +10,8 b' from .widget import DOMWidget'
10 import sys
10 import sys
11 from IPython.utils.traitlets import Unicode, List
11 from IPython.utils.traitlets import Unicode, List
12 from IPython.display import clear_output
12 from IPython.display import clear_output
13 from IPython.testing.skipdoctest import skip_doctest
14 from IPython.kernel.zmq.session import Message
13 from IPython.kernel.zmq.session import Message
15
14
16 @skip_doctest
17 class Output(DOMWidget):
15 class Output(DOMWidget):
18 """Widget used as a context manager to display output.
16 """Widget used as a context manager to display output.
19
17
@@ -44,7 +44,6 b' from pygments.token import ('
44 from pygments.util import get_bool_opt
44 from pygments.util import get_bool_opt
45
45
46 # Local
46 # Local
47 from IPython.testing.skipdoctest import skip_doctest
48
47
49 line_re = re.compile('.*?\n')
48 line_re = re.compile('.*?\n')
50
49
@@ -190,7 +189,6 b' class IPythonTracebackLexer(DelegatingLexer):'
190 DelegatingLexer.__init__(self, IPyLexer,
189 DelegatingLexer.__init__(self, IPyLexer,
191 IPythonPartialTracebackLexer, **options)
190 IPythonPartialTracebackLexer, **options)
192
191
193 @skip_doctest
194 class IPythonConsoleLexer(Lexer):
192 class IPythonConsoleLexer(Lexer):
195 """
193 """
196 An IPython console lexer for IPython code-blocks and doctests, such as:
194 An IPython console lexer for IPython code-blocks and doctests, such as:
@@ -11,7 +11,6 b' import random'
11
11
12 # Our own
12 # Our own
13 from IPython.core.error import UsageError
13 from IPython.core.error import UsageError
14 from IPython.testing.skipdoctest import skip_doctest
15 from IPython.utils.py3compat import cast_bytes, str_to_bytes
14 from IPython.utils.py3compat import cast_bytes, str_to_bytes
16
15
17 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
@@ -26,7 +25,6 b' salt_len = 12'
26 # Functions
25 # Functions
27 #-----------------------------------------------------------------------------
26 #-----------------------------------------------------------------------------
28
27
29 @skip_doctest
30 def passwd(passphrase=None, algorithm='sha1'):
28 def passwd(passphrase=None, algorithm='sha1'):
31 """Generate hashed password and salt for use in notebook configuration.
29 """Generate hashed password and salt for use in notebook configuration.
32
30
@@ -25,7 +25,6 b' from IPython.core.inputsplitter import IPythonInputSplitter'
25 from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC
25 from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC
26 from IPython.core.magic import Magics, magics_class, line_magic
26 from IPython.core.magic import Magics, magics_class, line_magic
27 from IPython.lib.clipboard import ClipboardEmpty
27 from IPython.lib.clipboard import ClipboardEmpty
28 from IPython.testing.skipdoctest import skip_doctest
29 from IPython.utils.encoding import get_stream_enc
28 from IPython.utils.encoding import get_stream_enc
30 from IPython.utils import py3compat
29 from IPython.utils import py3compat
31 from IPython.utils.terminal import toggle_set_term_title, set_term_title
30 from IPython.utils.terminal import toggle_set_term_title, set_term_title
@@ -130,7 +129,6 b' class TerminalMagics(Magics):'
130 self.shell.set_autoindent()
129 self.shell.set_autoindent()
131 print("Automatic indentation is:",['OFF','ON'][self.shell.autoindent])
130 print("Automatic indentation is:",['OFF','ON'][self.shell.autoindent])
132
131
133 @skip_doctest
134 @line_magic
132 @line_magic
135 def cpaste(self, parameter_s=''):
133 def cpaste(self, parameter_s=''):
136 """Paste & execute a pre-formatted code block from clipboard.
134 """Paste & execute a pre-formatted code block from clipboard.
@@ -463,10 +463,6 b' def run_iptest():'
463
463
464
464
465 argv = sys.argv + [ '--detailed-errors', # extra info in tracebacks
465 argv = sys.argv + [ '--detailed-errors', # extra info in tracebacks
466
467 '--with-ipdoctest',
468 '--ipdoctest-tests','--ipdoctest-extension=txt',
469
470 # We add --exe because of setuptools' imbecility (it
466 # We add --exe because of setuptools' imbecility (it
471 # blindly does chmod +x on ALL files). Nose does the
467 # blindly does chmod +x on ALL files). Nose does the
472 # right thing and it tries to avoid executables,
468 # right thing and it tries to avoid executables,
@@ -489,11 +485,19 b' def run_iptest():'
489 # for nose >= 0.11, though unfortunately nose 0.10 doesn't support it.
485 # for nose >= 0.11, though unfortunately nose 0.10 doesn't support it.
490 argv.append('--traverse-namespace')
486 argv.append('--traverse-namespace')
491
487
492 # use our plugin for doctesting. It will remove the standard doctest plugin
488 plugins = [ ExclusionPlugin(section.excludes), KnownFailure(),
493 # if it finds it enabled
494 plugins = [ExclusionPlugin(section.excludes), IPythonDoctest(), KnownFailure(),
495 SubprocessStreamCapturePlugin() ]
489 SubprocessStreamCapturePlugin() ]
496
490
491 # we still have some vestigial doctests in core
492 if (section.name.startswith(('core', 'IPython.core'))):
493 plugins.append(IPythonDoctest())
494 argv.extend([
495 '--with-ipdoctest',
496 '--ipdoctest-tests',
497 '--ipdoctest-extension=txt',
498 ])
499
500
497 # Use working directory set by parent process (see iptestcontroller)
501 # Use working directory set by parent process (see iptestcontroller)
498 if 'IPTEST_WORKING_DIR' in os.environ:
502 if 'IPTEST_WORKING_DIR' in os.environ:
499 os.chdir(os.environ['IPTEST_WORKING_DIR'])
503 os.chdir(os.environ['IPTEST_WORKING_DIR'])
@@ -12,7 +12,6 b' import nose.tools as nt'
12
12
13 # Our own
13 # Our own
14 from IPython.testing import decorators as dec
14 from IPython.testing import decorators as dec
15 from IPython.testing.skipdoctest import skip_doctest
16
15
17 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
18 # Utilities
17 # Utilities
@@ -61,7 +60,6 b' def test_deliberately_broken2():'
61
60
62 # Verify that we can correctly skip the doctest for a function at will, but
61 # Verify that we can correctly skip the doctest for a function at will, but
63 # that the docstring itself is NOT destroyed by the decorator.
62 # that the docstring itself is NOT destroyed by the decorator.
64 @skip_doctest
65 def doctest_bad(x,y=1,**k):
63 def doctest_bad(x,y=1,**k):
66 """A function whose doctest we need to skip.
64 """A function whose doctest we need to skip.
67
65
@@ -109,7 +107,6 b' class FooClass(object):'
109 2
107 2
110 """
108 """
111
109
112 @skip_doctest
113 def __init__(self,x):
110 def __init__(self,x):
114 """Make a FooClass.
111 """Make a FooClass.
115
112
@@ -121,7 +118,6 b' class FooClass(object):'
121 print('Making a FooClass.')
118 print('Making a FooClass.')
122 self.x = x
119 self.x = x
123
120
124 @skip_doctest
125 def bar(self,y):
121 def bar(self,y):
126 """Example:
122 """Example:
127
123
@@ -16,7 +16,6 b' import glob'
16 from warnings import warn
16 from warnings import warn
17 from hashlib import md5
17 from hashlib import md5
18
18
19 from IPython.testing.skipdoctest import skip_doctest
20 from IPython.utils.process import system
19 from IPython.utils.process import system
21 from IPython.utils import py3compat
20 from IPython.utils import py3compat
22 from IPython.utils.decorators import undoc
21 from IPython.utils.decorators import undoc
@@ -32,7 +31,6 b' def _writable_dir(path):'
32 return os.path.isdir(path) and os.access(path, os.W_OK)
31 return os.path.isdir(path) and os.access(path, os.W_OK)
33
32
34 if sys.platform == 'win32':
33 if sys.platform == 'win32':
35 @skip_doctest
36 def _get_long_path_name(path):
34 def _get_long_path_name(path):
37 """Get a long path name (expand ~) on Windows using ctypes.
35 """Get a long path name (expand ~) on Windows using ctypes.
38
36
@@ -646,7 +646,6 b' def _get_or_default(mylist, i, default=None):'
646 return mylist[i]
646 return mylist[i]
647
647
648
648
649 @skip_doctest
650 def compute_item_matrix(items, empty=None, *args, **kwargs) :
649 def compute_item_matrix(items, empty=None, *args, **kwargs) :
651 """Returns a nested list, and info to columnize items
650 """Returns a nested list, and info to columnize items
652
651
@@ -38,7 +38,6 b' from ipython_kernel.inprocess.socket import SocketABC'
38 from ipython_kernel import (
38 from ipython_kernel import (
39 get_connection_file, get_connection_info, connect_qtconsole
39 get_connection_file, get_connection_info, connect_qtconsole
40 )
40 )
41 from IPython.testing.skipdoctest import skip_doctest
42 from IPython.utils import openpy
41 from IPython.utils import openpy
43 from jupyter_client.jsonutil import json_clean, encode_images
42 from jupyter_client.jsonutil import json_clean, encode_images
44 from IPython.utils.process import arg_split
43 from IPython.utils.process import arg_split
@@ -105,7 +104,6 b' class KernelMagics(Magics):'
105
104
106 _find_edit_target = CodeMagics._find_edit_target
105 _find_edit_target = CodeMagics._find_edit_target
107
106
108 @skip_doctest
109 @line_magic
107 @line_magic
110 def edit(self, parameter_s='', last_call=['','']):
108 def edit(self, parameter_s='', last_call=['','']):
111 """Bring up an editor and execute the resulting code.
109 """Bring up an editor and execute the resulting code.
@@ -45,7 +45,6 b' import re'
45 from IPython.core.error import UsageError
45 from IPython.core.error import UsageError
46 from IPython.core.magic import Magics
46 from IPython.core.magic import Magics
47 from IPython.core import magic_arguments
47 from IPython.core import magic_arguments
48 from IPython.testing.skipdoctest import skip_doctest
49 from IPython.utils.text import dedent
48 from IPython.utils.text import dedent
50
49
51 #-----------------------------------------------------------------------------
50 #-----------------------------------------------------------------------------
@@ -190,7 +189,6 b' class ParallelMagics(Magics):'
190
189
191 @magic_arguments.magic_arguments()
190 @magic_arguments.magic_arguments()
192 @output_args
191 @output_args
193 @skip_doctest
194 def result(self, line=''):
192 def result(self, line=''):
195 """Print the result of the last asynchronous %px command.
193 """Print the result of the last asynchronous %px command.
196
194
@@ -218,7 +216,6 b' class ParallelMagics(Magics):'
218 self.last_result.get()
216 self.last_result.get()
219 self.last_result.display_outputs(groupby=args.groupby)
217 self.last_result.display_outputs(groupby=args.groupby)
220
218
221 @skip_doctest
222 def px(self, line=''):
219 def px(self, line=''):
223 """Executes the given python command in parallel.
220 """Executes the given python command in parallel.
224
221
@@ -269,7 +266,6 b' class ParallelMagics(Magics):'
269 @magic_arguments.magic_arguments()
266 @magic_arguments.magic_arguments()
270 @exec_args
267 @exec_args
271 @output_args
268 @output_args
272 @skip_doctest
273 def cell_px(self, line='', cell=None):
269 def cell_px(self, line='', cell=None):
274 """Executes the cell in parallel.
270 """Executes the cell in parallel.
275
271
@@ -316,7 +312,6 b' class ParallelMagics(Magics):'
316 if not block:
312 if not block:
317 return ar
313 return ar
318
314
319 @skip_doctest
320 def autopx(self, line=''):
315 def autopx(self, line=''):
321 """Toggles auto parallel mode.
316 """Toggles auto parallel mode.
322
317
@@ -9,7 +9,6 b' import sys'
9 import warnings
9 import warnings
10
10
11 from decorator import decorator
11 from decorator import decorator
12 from IPython.testing.skipdoctest import skip_doctest
13
12
14 from . import map as Map
13 from . import map as Map
15 from .asyncresult import AsyncMapResult
14 from .asyncresult import AsyncMapResult
@@ -18,7 +17,6 b' from .asyncresult import AsyncMapResult'
18 # Functions and Decorators
17 # Functions and Decorators
19 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
20
19
21 @skip_doctest
22 def remote(view, block=None, **flags):
20 def remote(view, block=None, **flags):
23 """Turn a function into a remote function.
21 """Turn a function into a remote function.
24
22
@@ -33,7 +31,6 b' def remote(view, block=None, **flags):'
33 return RemoteFunction(view, f, block=block, **flags)
31 return RemoteFunction(view, f, block=block, **flags)
34 return remote_function
32 return remote_function
35
33
36 @skip_doctest
37 def parallel(view, dist='b', block=None, ordered=True, **flags):
34 def parallel(view, dist='b', block=None, ordered=True, **flags):
38 """Turn a function into a parallel remote function.
35 """Turn a function into a parallel remote function.
39
36
@@ -13,7 +13,6 b' from types import ModuleType'
13
13
14 import zmq
14 import zmq
15
15
16 from IPython.testing.skipdoctest import skip_doctest
17 from IPython.utils import pickleutil
16 from IPython.utils import pickleutil
18 from IPython.utils.traitlets import (
17 from IPython.utils.traitlets import (
19 HasTraits, Any, Bool, List, Dict, Set, Instance, CFloat, Integer
18 HasTraits, Any, Bool, List, Dict, Set, Instance, CFloat, Integer
@@ -69,7 +68,6 b' def spin_after(f, self, *args, **kwargs):'
69 # Classes
68 # Classes
70 #-----------------------------------------------------------------------------
69 #-----------------------------------------------------------------------------
71
70
72 @skip_doctest
73 class View(HasTraits):
71 class View(HasTraits):
74 """Base View class for more convenint apply(f,*args,**kwargs) syntax via attributes.
72 """Base View class for more convenint apply(f,*args,**kwargs) syntax via attributes.
75
73
@@ -377,7 +375,6 b' class View(HasTraits):'
377 block = self.block if block is None else block
375 block = self.block if block is None else block
378 return parallel(self, dist=dist, block=block, **flags)
376 return parallel(self, dist=dist, block=block, **flags)
379
377
380 @skip_doctest
381 class DirectView(View):
378 class DirectView(View):
382 """Direct Multiplexer View of one or more engines.
379 """Direct Multiplexer View of one or more engines.
383
380
@@ -845,7 +842,6 b' class DirectView(View):'
845 ip.magics_manager.register(M)
842 ip.magics_manager.register(M)
846
843
847
844
848 @skip_doctest
849 class LoadBalancedView(View):
845 class LoadBalancedView(View):
850 """An load-balancing View that only executes via the Task scheduler.
846 """An load-balancing View that only executes via the Task scheduler.
851
847
@@ -58,7 +58,6 b' from IPython.utils import eventful'
58 from IPython.utils.getargspec import getargspec
58 from IPython.utils.getargspec import getargspec
59 from IPython.utils.importstring import import_item
59 from IPython.utils.importstring import import_item
60 from IPython.utils.py3compat import iteritems, string_types
60 from IPython.utils.py3compat import iteritems, string_types
61 from IPython.testing.skipdoctest import skip_doctest
62
61
63 from .sentinel import Sentinel
62 from .sentinel import Sentinel
64 SequenceTypes = (list, tuple, set, frozenset)
63 SequenceTypes = (list, tuple, set, frozenset)
@@ -189,7 +188,6 b' def _validate_link(*tuples):'
189 if not trait_name in obj.traits():
188 if not trait_name in obj.traits():
190 raise TypeError("%r has no trait %r" % (obj, trait_name))
189 raise TypeError("%r has no trait %r" % (obj, trait_name))
191
190
192 @skip_doctest
193 class link(object):
191 class link(object):
194 """Link traits from different objects together so they remain in sync.
192 """Link traits from different objects together so they remain in sync.
195
193
@@ -244,7 +242,6 b' class link(object):'
244 (obj, attr) = key
242 (obj, attr) = key
245 obj.on_trait_change(callback, attr, remove=True)
243 obj.on_trait_change(callback, attr, remove=True)
246
244
247 @skip_doctest
248 class directional_link(object):
245 class directional_link(object):
249 """Link the trait of a source object with traits of target objects.
246 """Link the trait of a source object with traits of target objects.
250
247
General Comments 0
You need to be logged in to leave comments. Login now