From d704370c6363a37e84776cd3d6498b75775f5d57 2008-08-02 02:16:44 From: Fernando Perez Date: 2008-08-02 02:16:44 Subject: [PATCH] Add a few more tests to the test machinery itself. --- diff --git a/IPython/testing/plugin/dtexample.py b/IPython/testing/plugin/dtexample.py index e0944ee..dea37eb 100644 --- a/IPython/testing/plugin/dtexample.py +++ b/IPython/testing/plugin/dtexample.py @@ -123,3 +123,37 @@ def random_all(): blah... """ pass + + +def iprand(): + """Some ipython tests with random output. + + In [7]: 3+4 + Out[7]: 7 + + In [8]: print 'hello' + world # random + + In [9]: iprand() + Out[9]: 'iprand' + """ + return 'iprand' + + +def iprand_all(): + """Some ipython tests with fully random output. + + # all-random + + In [7]: 1 + Out[7]: 99 + + In [8]: print 'hello' + world + + In [9]: iprand_all() + Out[9]: 'junk' + """ + return 'iprand_all' + + diff --git a/IPython/testing/plugin/ipdoctest.py b/IPython/testing/plugin/ipdoctest.py index cbc570c..e41663c 100644 --- a/IPython/testing/plugin/ipdoctest.py +++ b/IPython/testing/plugin/ipdoctest.py @@ -220,8 +220,6 @@ class DocTestFinder(doctest.DocTestFinder): if inspect.isclass(obj) and self._recurse: #print 'RECURSE into class:',obj # dbg for valname, val in obj.__dict__.items(): - #valname1 = '%s.%s' % (name, valname) # dbg - #print 'N',name,'VN:',valname,'val:',str(val)[:77] # dbg # Special handling for staticmethod/classmethod. if isinstance(val, staticmethod): val = getattr(obj, valname) @@ -300,8 +298,6 @@ class DocTestCase(doctests.DocTestCase): # Modified runTest from the default stdlib def runTest(self): - #print 'HERE!' # dbg - test = self._dt_test old = sys.stdout new = StringIO() @@ -481,7 +477,6 @@ class IPDocTestParser(doctest.DocTestParser): # Create an Example, and add it to the list. if not self._IS_BLANK_OR_COMMENT(source): - #print 'Example source:', source # dbg output.append(Example(source, want, exc_msg, lineno=lineno, indent=min_indent+len(m.group('indent')),