]> granicus.if.org Git - python/commitdiff
The attempt to shut up deprecation warnings for doctest's own use of
authorTim Peters <tim.peters@gmail.com>
Mon, 23 Aug 2004 22:42:55 +0000 (22:42 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 23 Aug 2004 22:42:55 +0000 (22:42 +0000)
is_private in its tests failed if doctest.py was run directly.  Now
it works.

Lib/doctest.py

index 3fe837b70fe3e03f7ff3c447fe2551de24819da1..43f21b2e1c6c02915f2f9f2d073d3525f658dd66 100644 (file)
@@ -220,6 +220,11 @@ import unittest, difflib, pdb, tempfile
 import warnings
 from StringIO import StringIO
 
+# Don't whine about the deprecated is_private function in this
+# module's tests.
+warnings.filterwarnings("ignore", "is_private", DeprecationWarning,
+                        __name__, 0)
+
 real_pdb_set_trace = pdb.set_trace
 
 # There are 4 basic classes:
@@ -287,8 +292,6 @@ def is_private(prefix, base):
     Return true iff base begins with an (at least one) underscore, but
     does not both begin and end with (at least) two underscores.
 
-    >>> warnings.filterwarnings("ignore", "is_private", DeprecationWarning,
-    ...                         "doctest", 0)
     >>> is_private("a.b", "my_func")
     False
     >>> is_private("____", "_my_func")