##// END OF EJS Templates
Merging -r 1196 from lp:ipython....
Brian Granger -
r2150:b44b6920 merge
parent child Browse files
Show More
@@ -43,7 +43,6 b' def doctest_hist_f():'
43 In [10]: tfile = tempfile.mktemp('.py','tmp-ipython-')
43 In [10]: tfile = tempfile.mktemp('.py','tmp-ipython-')
44
44
45 In [11]: %hist -n -f $tfile 3
45 In [11]: %hist -n -f $tfile 3
46
47 """
46 """
48
47
49
48
@@ -2,6 +2,9 b''
2
2
3 XXX - This module is missing proper docs.
3 XXX - This module is missing proper docs.
4 """
4 """
5 # Tell nose to skip this module
6 __test__ = {}
7
5 import sys
8 import sys
6
9
7 from twisted.internet import reactor, threads
10 from twisted.internet import reactor, threads
@@ -3,6 +3,9 b' Base front end class for all async frontends.'
3 """
3 """
4 __docformat__ = "restructuredtext en"
4 __docformat__ = "restructuredtext en"
5
5
6 # Tell nose to skip this module
7 __test__ = {}
8
6 #-------------------------------------------------------------------------------
9 #-------------------------------------------------------------------------------
7 # Copyright (C) 2008 The IPython Development Team
10 # Copyright (C) 2008 The IPython Development Team
8 #
11 #
@@ -10,20 +13,25 b' __docformat__ = "restructuredtext en"'
10 # the file COPYING, distributed as part of this software.
13 # the file COPYING, distributed as part of this software.
11 #-------------------------------------------------------------------------------
14 #-------------------------------------------------------------------------------
12
15
13
14 #-------------------------------------------------------------------------------
16 #-------------------------------------------------------------------------------
15 # Imports
17 # Imports
16 #-------------------------------------------------------------------------------
18 #-------------------------------------------------------------------------------
17
19
20 # Third-party
21 from twisted.python.failure import Failure
22 from zope.interface import implements, classProvides
23
24 # From IPython
18 from IPython.external import guid
25 from IPython.external import guid
19
26
20 from zope.interface import Interface, Attribute, implements, classProvides
27 from IPython.frontend.frontendbase import (FrontEndBase, IFrontEnd,
21 from twisted.python.failure import Failure
28 IFrontEndFactory)
22 from IPython.frontend.frontendbase import (
23 FrontEndBase, IFrontEnd, IFrontEndFactory)
24 from IPython.kernel.core.history import FrontEndHistory
29 from IPython.kernel.core.history import FrontEndHistory
25 from IPython.kernel.engineservice import IEngineCore
30 from IPython.kernel.engineservice import IEngineCore
26
31
32 #-----------------------------------------------------------------------------
33 # Classes and functions
34 #-----------------------------------------------------------------------------
27
35
28 class AsyncFrontEndBase(FrontEndBase):
36 class AsyncFrontEndBase(FrontEndBase):
29 """
37 """
@@ -41,8 +49,7 b' class AsyncFrontEndBase(FrontEndBase):'
41 self.history = FrontEndHistory(input_cache=[''])
49 self.history = FrontEndHistory(input_cache=[''])
42 else:
50 else:
43 self.history = history
51 self.history = history
44
52
45
46 def execute(self, block, blockID=None):
53 def execute(self, block, blockID=None):
47 """Execute the block and return the deferred result.
54 """Execute the block and return the deferred result.
48
55
@@ -73,5 +80,3 b' class AsyncFrontEndBase(FrontEndBase):'
73 errback=self.render_error)
80 errback=self.render_error)
74
81
75 return d
82 return d
76
77
@@ -3,6 +3,9 b''
3 """This file contains unittests for the asyncfrontendbase module."""
3 """This file contains unittests for the asyncfrontendbase module."""
4
4
5 __docformat__ = "restructuredtext en"
5 __docformat__ = "restructuredtext en"
6
7 # Tell nose to skip this module
8 __test__ = {}
6
9
7 #---------------------------------------------------------------------------
10 #---------------------------------------------------------------------------
8 # Copyright (C) 2008 The IPython Development Team
11 # Copyright (C) 2008 The IPython Development Team
@@ -10,20 +13,21 b' __docformat__ = "restructuredtext en"'
10 # Distributed under the terms of the BSD License. The full license is in
13 # Distributed under the terms of the BSD License. The full license is in
11 # the file COPYING, distributed as part of this software.
14 # the file COPYING, distributed as part of this software.
12 #---------------------------------------------------------------------------
15 #---------------------------------------------------------------------------
13
16
14 #---------------------------------------------------------------------------
17 #---------------------------------------------------------------------------
15 # Imports
18 # Imports
16 #---------------------------------------------------------------------------
19 #---------------------------------------------------------------------------
17
20
18 # Tell nose to skip this module
19 __test__ = {}
20
21 from twisted.trial import unittest
21 from twisted.trial import unittest
22
22 from IPython.frontend.asyncfrontendbase import AsyncFrontEndBase
23 from IPython.frontend.asyncfrontendbase import AsyncFrontEndBase
23 from IPython.frontend import frontendbase
24 from IPython.frontend import frontendbase
24 from IPython.kernel.engineservice import EngineService
25 from IPython.kernel.engineservice import EngineService
25 from IPython.testing.parametric import Parametric, parametric
26 from IPython.testing.parametric import Parametric, parametric
26
27
28 #-----------------------------------------------------------------------------
29 # Classes and functions
30 #-----------------------------------------------------------------------------
27
31
28 class FrontEndCallbackChecker(AsyncFrontEndBase):
32 class FrontEndCallbackChecker(AsyncFrontEndBase):
29 """FrontEndBase subclass for checking callbacks"""
33 """FrontEndBase subclass for checking callbacks"""
@@ -106,4 +110,3 b' class TestAsyncFrontendBase(unittest.TestCase):'
106 def test_history_returns_none_at_startup(self):
110 def test_history_returns_none_at_startup(self):
107 self.assert_(self.fb.get_history_previous("")==None)
111 self.assert_(self.fb.get_history_previous("")==None)
108 self.assert_(self.fb.get_history_next()==None)
112 self.assert_(self.fb.get_history_next()==None)
109
@@ -23,6 +23,10 b' method that automatically added methods to engines.'
23
23
24 __docformat__ = "restructuredtext en"
24 __docformat__ = "restructuredtext en"
25
25
26 # Tell nose to skip this module. I don't think we need this as nose
27 # shouldn't ever be run on this!
28 __test__ = {}
29
26 #-------------------------------------------------------------------------------
30 #-------------------------------------------------------------------------------
27 # Copyright (C) 2008 The IPython Development Team
31 # Copyright (C) 2008 The IPython Development Team
28 #
32 #
@@ -34,12 +38,9 b' __docformat__ = "restructuredtext en"'
34 # Imports
38 # Imports
35 #-------------------------------------------------------------------------------
39 #-------------------------------------------------------------------------------
36
40
37 # Tell nose to skip the testing of this module
41 import copy
38 __test__ = {}
42 import sys
39
40 import os, sys, copy
41 import cPickle as pickle
43 import cPickle as pickle
42 from new import instancemethod
43
44
44 from twisted.application import service
45 from twisted.application import service
45 from twisted.internet import defer, reactor
46 from twisted.internet import defer, reactor
@@ -47,11 +48,7 b' from twisted.python import log, failure, components'
47 import zope.interface as zi
48 import zope.interface as zi
48
49
49 from IPython.kernel.core.interpreter import Interpreter
50 from IPython.kernel.core.interpreter import Interpreter
50 from IPython.kernel import newserialized, error, util
51 from IPython.kernel import newserialized, error
51 from IPython.kernel.util import printer
52 from IPython.kernel.twistedutil import gatherBoth, DeferredList
53 from IPython.kernel import codeutil
54
55
52
56 #-------------------------------------------------------------------------------
53 #-------------------------------------------------------------------------------
57 # Interface specification for the Engine
54 # Interface specification for the Engine
@@ -4,6 +4,9 b''
4
4
5 __docformat__ = "restructuredtext en"
5 __docformat__ = "restructuredtext en"
6
6
7 # Tell nose to skip this module
8 __test__ = {}
9
7 #-------------------------------------------------------------------------------
10 #-------------------------------------------------------------------------------
8 # Copyright (C) 2008 The IPython Development Team
11 # Copyright (C) 2008 The IPython Development Team
9 #
12 #
@@ -14,9 +17,9 b' __docformat__ = "restructuredtext en"'
14 #-------------------------------------------------------------------------------
17 #-------------------------------------------------------------------------------
15 # Imports
18 # Imports
16 #-------------------------------------------------------------------------------
19 #-------------------------------------------------------------------------------
20 from twisted.python import failure
17
21
18 from IPython.kernel.core import error
22 from IPython.kernel.core import error
19 from twisted.python import failure
20
23
21 #-------------------------------------------------------------------------------
24 #-------------------------------------------------------------------------------
22 # Error classes
25 # Error classes
@@ -5,6 +5,9 b''
5
5
6 __docformat__ = "restructuredtext en"
6 __docformat__ = "restructuredtext en"
7
7
8 # Tell nose to skip this module
9 __test__ = {}
10
8 #-------------------------------------------------------------------------------
11 #-------------------------------------------------------------------------------
9 # Copyright (C) 2008 The IPython Development Team
12 # Copyright (C) 2008 The IPython Development Team
10 #
13 #
@@ -18,8 +21,8 b' __docformat__ = "restructuredtext en"'
18
21
19 import cPickle as pickle
22 import cPickle as pickle
20
23
21 from zope.interface import Interface, implements
22 from twisted.python import components
24 from twisted.python import components
25 from zope.interface import Interface, implements
23
26
24 try:
27 try:
25 import numpy
28 import numpy
@@ -28,6 +31,10 b' except ImportError:'
28
31
29 from IPython.kernel.error import SerializationError
32 from IPython.kernel.error import SerializationError
30
33
34 #-----------------------------------------------------------------------------
35 # Classes and functions
36 #-----------------------------------------------------------------------------
37
31 class ISerialized(Interface):
38 class ISerialized(Interface):
32
39
33 def getData():
40 def getData():
@@ -108,6 +108,27 b' def make_exclude():'
108 if not have_pexpect:
108 if not have_pexpect:
109 EXCLUDE.append(pjoin('IPython', 'scripts', 'irunner'))
109 EXCLUDE.append(pjoin('IPython', 'scripts', 'irunner'))
110
110
111 # This is scary. We still have things in frontend and testing that
112 # are being tested by nose that use twisted. We need to rethink
113 # how we are isolating dependencies in testing.
114 if not (have_twisted and have_zi and have_foolscap):
115 EXCLUDE.append(pjoin('IPython', 'frontend', 'asyncfrontendbase'))
116 EXCLUDE.append(pjoin('IPython', 'frontend', 'prefilterfrontend'))
117 EXCLUDE.append(pjoin('IPython', 'frontend', 'frontendbase'))
118 EXCLUDE.append(pjoin('IPython', 'frontend', 'linefrontendbase'))
119 EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
120 'test_linefrontend'))
121 EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
122 'test_frontendbase'))
123 EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
124 'test_prefilterfrontend'))
125 EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
126 'test_asyncfrontendbase')),
127 EXCLUDE.append(pjoin('IPython', 'testing', 'parametric'))
128 EXCLUDE.append(pjoin('IPython', 'testing', 'util'))
129 EXCLUDE.append(pjoin('IPython', 'testing', 'tests',
130 'test_decorators_trial'))
131
111 # Skip shell always because of a bug in FakeModule.
132 # Skip shell always because of a bug in FakeModule.
112 EXCLUDE.append(pjoin('IPython', 'core', 'shell'))
133 EXCLUDE.append(pjoin('IPython', 'core', 'shell'))
113
134
General Comments 0
You need to be logged in to leave comments. Login now