[Python-checkins] python/dist/src/Lib/test test_doctest.py, 1.48,
1.49
edloper at users.sourceforge.net
edloper at users.sourceforge.net
Tue Sep 21 05:20:37 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17277/Lib/test
Modified Files:
test_doctest.py
Log Message:
- Changed SampleClass docstrings to test docstring parsing a little
more thouroughly.
Index: test_doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_doctest.py,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- test_doctest.py 19 Sep 2004 17:19:33 -0000 1.48
+++ test_doctest.py 21 Sep 2004 03:20:34 -0000 1.49
@@ -25,6 +25,17 @@
"""
>>> print 1
1
+
+ >>> # comments get ignored. so are empty PS1 and PS2 prompts:
+ >>>
+ ...
+
+ Multiline example:
+ >>> sc = SampleClass(3)
+ >>> for i in range(10):
+ ... sc = sc.double()
+ ... print sc.get(),
+ 6 12 24 48 96 192 384 768 1536 3072
"""
def __init__(self, val):
"""
@@ -411,7 +422,7 @@
>>> tests.sort()
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
- 1 SampleClass
+ 3 SampleClass
3 SampleClass.NestedClass
1 SampleClass.NestedClass.__init__
1 SampleClass.__init__
@@ -443,7 +454,7 @@
>>> m = new.module('some_module')
>>> def triple(val):
... '''
- ... >>> print tripple(11)
+ ... >>> print triple(11)
... 33
... '''
... return val*3
@@ -468,7 +479,7 @@
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
1 some_module
- 1 some_module.SampleClass
+ 3 some_module.SampleClass
3 some_module.SampleClass.NestedClass
1 some_module.SampleClass.NestedClass.__init__
1 some_module.SampleClass.__init__
@@ -513,7 +524,7 @@
>>> tests.sort()
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
- 1 SampleClass
+ 3 SampleClass
3 SampleClass.NestedClass
1 SampleClass.NestedClass.__init__
1 SampleClass.__init__
@@ -530,7 +541,7 @@
>>> tests.sort()
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
- 1 SampleClass
+ 3 SampleClass
3 SampleClass.NestedClass
1 SampleClass.NestedClass.__init__
0 SampleClass.NestedClass.get
@@ -548,7 +559,7 @@
>>> tests.sort()
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
- 1 SampleClass
+ 3 SampleClass
1 SampleClass.__init__
2 SampleClass.a_classmethod
1 SampleClass.a_property
@@ -574,7 +585,7 @@
>>> tests.sort()
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
- 1 SampleClass
+ 3 SampleClass
Line numbers
~~~~~~~~~~~~
More information about the Python-checkins
mailing list