[Python-checkins] python/dist/src/Lib doctest.py, 1.36.2.24,
1.36.2.25
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Fri Aug 6 21:53:03 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2308/Lib
Modified Files:
Tag: tim-doctest-branch
doctest.py
Log Message:
Removed the comment before globs.clear(). It's no longer true that
Python gc doesn't chase frame objects.
Plus accidental trailing-whitespace trimming (my editor does this).
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.36.2.24
retrieving revision 1.36.2.25
diff -C2 -d -r1.36.2.24 -r1.36.2.25
*** doctest.py 6 Aug 2004 18:48:43 -0000 1.36.2.24
--- doctest.py 6 Aug 2004 19:53:00 -0000 1.36.2.25
***************
*** 793,797 ****
"""
! def __init__(self, verbose=False, doctest_factory=DocTest,
namefilter=None, objfilter=None, recurse=True):
"""
--- 793,797 ----
"""
! def __init__(self, verbose=False, doctest_factory=DocTest,
namefilter=None, objfilter=None, recurse=True):
"""
***************
*** 1502,1513 ****
finally:
sys.stdout = saveout
- # While Python gc can clean up most cycles on its own, it doesn't
- # chase frame objects. This is especially irksome when running
- # generator tests that raise exceptions, because a named generator-
- # iterator gets an entry in globs, and the generator-iterator
- # object's frame's traceback info points back to globs. This is
- # easy to break just by clearing the namespace. This can also
- # help to break other kinds of cycles, and even for cycles that
- # gc can break itself it's better to break them ASAP.
if clear_globs:
test.globs.clear()
--- 1502,1505 ----
***************
*** 1589,1594 ****
return str(self.test)
!
!
class DebugRunner(DocTestRunner):
r"""Run doc tests but raise an exception as soon as there is a failure.
--- 1581,1586 ----
return str(self.test)
!
!
class DebugRunner(DocTestRunner):
r"""Run doc tests but raise an exception as soon as there is a failure.
***************
*** 1637,1641 ****
>>> test.globs
{'x': 1}
!
>>> test = DocTest('''
... >>> x = 2
--- 1629,1633 ----
>>> test.globs
{'x': 1}
!
>>> test = DocTest('''
... >>> x = 2
***************
*** 1660,1667 ****
>>> runner.run(test)
(0, 1)
!
>>> test.globs
{}
!
"""
--- 1652,1659 ----
>>> runner.run(test)
(0, 1)
!
>>> test.globs
{}
!
"""
***************
*** 2090,2094 ****
test = DocTest(doc, globs, name, path, 0)
!
return DocFileCase(test, optionflags, setUp, tearDown)
--- 2082,2086 ----
test = DocTest(doc, globs, name, path, 0)
!
return DocFileCase(test, optionflags, setUp, tearDown)
More information about the Python-checkins
mailing list