[Python-checkins] CVS: python/dist/src/Lib doctest.py,1.18,1.19
Tim Peters
tim_one@users.sourceforge.net
Tue, 02 Oct 2001 15:47:10 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Python errors.c,2.65,2.66
- Next message: [Python-checkins] CVS: python/dist/src/Demo/dns README,1.3,NONE asgethost.py,1.2,NONE dnsclass.py,1.1,NONE dnslib.py,1.3,NONE dnsopcode.py,1.1,NONE dnstype.py,1.1,NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv18405/python/Lib
Modified Files:
doctest.py
Log Message:
SF patch [#466616] Exclude imported items from doctest.
Another installment; the new functionality wasn't actually enabled in
normal use, only in the strained use checked by the test case.
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** doctest.py 2001/10/02 03:53:41 1.18
--- doctest.py 2001/10/02 22:47:08 1.19
***************
*** 771,775 ****
>>> m2 = new.module('_m2')
>>> test_data = \"""
! ... def f():
... '''>>> assert 1 == 1
... '''
--- 771,775 ----
>>> m2 = new.module('_m2')
>>> test_data = \"""
! ... def _f():
... '''>>> assert 1 == 1
... '''
***************
*** 786,796 ****
>>> exec test_data in m1.__dict__
>>> exec test_data in m2.__dict__
Tests that objects outside m1 are excluded:
- >>> d = {"_f": m1.f, "g": m1.g, "h": m1.H,
- ... "f2": m2.f, "g2": m2.g, "h2": m2.H}
>>> t = Tester(globs={}, verbose=0)
! >>> t.rundict(d, "rundict_test", m1) # _f, f2 and g2 and h2 skipped
(0, 3)
--- 786,795 ----
>>> exec test_data in m1.__dict__
>>> exec test_data in m2.__dict__
+ >>> m1.__dict__.update({"f2": m2._f, "g2": m2.g, "h2": m2.H})
Tests that objects outside m1 are excluded:
>>> t = Tester(globs={}, verbose=0)
! >>> t.rundict(m1.__dict__, "rundict_test", m1) # _f, f2 and g2 and h2 skipped
(0, 3)
***************
*** 798,802 ****
>>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
! >>> t.rundict(d, "rundict_test_pvt", m1) # Only f2, g2 and h2 skipped
(0, 4)
--- 797,801 ----
>>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
! >>> t.rundict(m1.__dict__, "rundict_test_pvt", m1) # Only f2, g2 and h2 skipped
(0, 4)
***************
*** 804,809 ****
>>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
! >>> t.rundict(d, "rundict_test_pvt") # None are skipped.
(0, 8)
"""
--- 803,815 ----
>>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
! >>> t.rundict(m1.__dict__, "rundict_test_pvt") # None are skipped.
(0, 8)
+
+ The exclusion of objects from outside the designated module is
+ meant to be invoked automagically by testmod.
+
+ >>> testmod(m1)
+ (0, 3)
+
"""
***************
*** 1038,1042 ****
tester = Tester(m, globs=globs, verbose=verbose, isprivate=isprivate)
failures, tries = tester.rundoc(m, name)
! f, t = tester.rundict(m.__dict__, name)
failures = failures + f
tries = tries + t
--- 1044,1048 ----
tester = Tester(m, globs=globs, verbose=verbose, isprivate=isprivate)
failures, tries = tester.rundoc(m, name)
! f, t = tester.rundict(m.__dict__, name, m)
failures = failures + f
tries = tries + t
- Previous message: [Python-checkins] CVS: python/dist/src/Python errors.c,2.65,2.66
- Next message: [Python-checkins] CVS: python/dist/src/Demo/dns README,1.3,NONE asgethost.py,1.2,NONE dnsclass.py,1.1,NONE dnslib.py,1.3,NONE dnsopcode.py,1.1,NONE dnstype.py,1.1,NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]