Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dda91726
Commit
dda91726
authored
Sep 21, 2004
by
Edward Loper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Changed SampleClass docstrings to test docstring parsing a little
more thouroughly.
parent
5a79a7a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
Lib/test/test_doctest.py
Lib/test/test_doctest.py
+18
-7
No files found.
Lib/test/test_doctest.py
View file @
dda91726
...
@@ -25,6 +25,17 @@ class SampleClass:
...
@@ -25,6 +25,17 @@ class SampleClass:
"""
"""
>>> print 1
>>> print 1
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
):
def
__init__
(
self
,
val
):
"""
"""
...
@@ -411,7 +422,7 @@ methods, classmethods, staticmethods, properties, and nested classes.
...
@@ -411,7 +422,7 @@ methods, classmethods, staticmethods, properties, and nested classes.
>>> tests.sort()
>>> tests.sort()
>>> for t in tests:
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
... print '%2s %s' % (len(t.examples), t.name)
1
SampleClass
3
SampleClass
3 SampleClass.NestedClass
3 SampleClass.NestedClass
1 SampleClass.NestedClass.__init__
1 SampleClass.NestedClass.__init__
1 SampleClass.__init__
1 SampleClass.__init__
...
@@ -443,7 +454,7 @@ functions, classes, and the `__test__` dictionary, if it exists:
...
@@ -443,7 +454,7 @@ functions, classes, and the `__test__` dictionary, if it exists:
>>> m = new.module('some_module')
>>> m = new.module('some_module')
>>> def triple(val):
>>> def triple(val):
... '''
... '''
... >>> print trip
p
le(11)
... >>> print triple(11)
... 33
... 33
... '''
... '''
... return val*3
... return val*3
...
@@ -468,7 +479,7 @@ functions, classes, and the `__test__` dictionary, if it exists:
...
@@ -468,7 +479,7 @@ functions, classes, and the `__test__` dictionary, if it exists:
>>> for t in tests:
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
... print '%2s %s' % (len(t.examples), t.name)
1 some_module
1 some_module
1
some_module.SampleClass
3
some_module.SampleClass
3 some_module.SampleClass.NestedClass
3 some_module.SampleClass.NestedClass
1 some_module.SampleClass.NestedClass.__init__
1 some_module.SampleClass.NestedClass.__init__
1 some_module.SampleClass.__init__
1 some_module.SampleClass.__init__
...
@@ -513,7 +524,7 @@ deprecated isprivate gimmick.
...
@@ -513,7 +524,7 @@ deprecated isprivate gimmick.
>>> tests.sort()
>>> tests.sort()
>>> for t in tests:
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
... print '%2s %s' % (len(t.examples), t.name)
1
SampleClass
3
SampleClass
3 SampleClass.NestedClass
3 SampleClass.NestedClass
1 SampleClass.NestedClass.__init__
1 SampleClass.NestedClass.__init__
1 SampleClass.__init__
1 SampleClass.__init__
...
@@ -530,7 +541,7 @@ displays.
...
@@ -530,7 +541,7 @@ displays.
>>> tests.sort()
>>> tests.sort()
>>> for t in tests:
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
... print '%2s %s' % (len(t.examples), t.name)
1
SampleClass
3
SampleClass
3 SampleClass.NestedClass
3 SampleClass.NestedClass
1 SampleClass.NestedClass.__init__
1 SampleClass.NestedClass.__init__
0 SampleClass.NestedClass.get
0 SampleClass.NestedClass.get
...
@@ -548,7 +559,7 @@ contains will be added either:
...
@@ -548,7 +559,7 @@ contains will be added either:
>>> tests.sort()
>>> tests.sort()
>>> for t in tests:
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
... print '%2s %s' % (len(t.examples), t.name)
1
SampleClass
3
SampleClass
1 SampleClass.__init__
1 SampleClass.__init__
2 SampleClass.a_classmethod
2 SampleClass.a_classmethod
1 SampleClass.a_property
1 SampleClass.a_property
...
@@ -574,7 +585,7 @@ using the `recurse` flag:
...
@@ -574,7 +585,7 @@ using the `recurse` flag:
>>> tests.sort()
>>> tests.sort()
>>> for t in tests:
>>> for t in tests:
... print '%2s %s' % (len(t.examples), t.name)
... print '%2s %s' % (len(t.examples), t.name)
1
SampleClass
3
SampleClass
Line numbers
Line numbers
~~~~~~~~~~~~
~~~~~~~~~~~~
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment