Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d704370

Browse files
committed
Add a few more tests to the test machinery itself.
1 parent 11c4c1e commit d704370

2 files changed

Lines changed: 34 additions & 5 deletions

File tree

IPython/testing/plugin/dtexample.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,37 @@ def random_all():
123123
blah...
124124
"""
125125
pass
126+
127+
128+
def iprand():
129+
"""Some ipython tests with random output.
130+
131+
In [7]: 3+4
132+
Out[7]: 7
133+
134+
In [8]: print 'hello'
135+
world # random
136+
137+
In [9]: iprand()
138+
Out[9]: 'iprand'
139+
"""
140+
return 'iprand'
141+
142+
143+
def iprand_all():
144+
"""Some ipython tests with fully random output.
145+
146+
# all-random
147+
148+
In [7]: 1
149+
Out[7]: 99
150+
151+
In [8]: print 'hello'
152+
world
153+
154+
In [9]: iprand_all()
155+
Out[9]: 'junk'
156+
"""
157+
return 'iprand_all'
158+
159+

IPython/testing/plugin/ipdoctest.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
220220
if inspect.isclass(obj) and self._recurse:
221221
#print 'RECURSE into class:',obj # dbg
222222
for valname, val in obj.__dict__.items():
223-
#valname1 = '%s.%s' % (name, valname) # dbg
224-
#print 'N',name,'VN:',valname,'val:',str(val)[:77] # dbg
225223
# Special handling for staticmethod/classmethod.
226224
if isinstance(val, staticmethod):
227225
val = getattr(obj, valname)
@@ -300,8 +298,6 @@ def __init__(self, test, optionflags=0, setUp=None, tearDown=None,
300298

301299
# Modified runTest from the default stdlib
302300
def runTest(self):
303-
#print 'HERE!' # dbg
304-
305301
test = self._dt_test
306302
old = sys.stdout
307303
new = StringIO()
@@ -481,7 +477,6 @@ def parse(self, string, name='<string>'):
481477

482478
# Create an Example, and add it to the list.
483479
if not self._IS_BLANK_OR_COMMENT(source):
484-
#print 'Example source:', source # dbg
485480
output.append(Example(source, want, exc_msg,
486481
lineno=lineno,
487482
indent=min_indent+len(m.group('indent')),

0 commit comments

Comments
 (0)