[Python-checkins] python/dist/src/Lib doctest.py,1.42,1.43
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Sun Aug 8 04:43:35 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4118/Lib
Modified Files:
doctest.py
Log Message:
Also deprecated the old Tester class, which is no longer used by anything
except internal tests.
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** doctest.py 8 Aug 2004 01:52:57 -0000 1.42
--- doctest.py 8 Aug 2004 02:43:32 -0000 1.43
***************
*** 378,382 ****
does not both begin and end with (at least) two underscores.
- >>> import warnings
>>> warnings.filterwarnings("ignore", "is_private", DeprecationWarning,
... "doctest", 0)
--- 378,381 ----
***************
*** 398,402 ****
warnings.warn("is_private is deprecated; it wasn't useful; "
"examine DocTestFinder.find() lists instead",
! DeprecationWarning)
return base[:1] == "_" and not base[:2] == "__" == base[-2:]
--- 397,401 ----
warnings.warn("is_private is deprecated; it wasn't useful; "
"examine DocTestFinder.find() lists instead",
! DeprecationWarning, stacklevel=2)
return base[:1] == "_" and not base[:2] == "__" == base[-2:]
***************
*** 1867,1870 ****
--- 1866,1873 ----
def __init__(self, mod=None, globs=None, verbose=None,
isprivate=None, optionflags=0):
+
+ warnings.warn("class Tester is deprecated; "
+ "use class doctest.DocTestRunner instead",
+ DeprecationWarning, stacklevel=2)
if mod is None and globs is None:
raise TypeError("Tester.__init__: must specify mod or globs")
***************
*** 2404,2407 ****
--- 2407,2412 ----
def test1(): r"""
+ >>> warnings.filterwarnings("ignore", "class Tester", DeprecationWarning,
+ ... "doctest", 0)
>>> from doctest import Tester
>>> t = Tester(globs={'x': 42}, verbose=0)
***************
*** 2438,2441 ****
--- 2443,2448 ----
def test2(): r"""
+ >>> warnings.filterwarnings("ignore", "class Tester",
+ ... DeprecationWarning, "doctest", 0)
>>> t = Tester(globs={}, verbose=1)
>>> test = r'''
***************
*** 2457,2460 ****
--- 2464,2469 ----
"""
def test3(): r"""
+ >>> warnings.filterwarnings("ignore", "class Tester",
+ ... DeprecationWarning, "doctest", 0)
>>> t = Tester(globs={}, verbose=0)
>>> def _f():
***************
*** 2491,2494 ****
--- 2500,2505 ----
Tests that objects outside m1 are excluded:
+ >>> warnings.filterwarnings("ignore", "class Tester",
+ ... DeprecationWarning, "doctest", 0)
>>> t = Tester(globs={}, verbose=0)
>>> t.rundict(m1.__dict__, "rundict_test", m1) # f2 and g2 and h2 skipped
More information about the Python-checkins
mailing list