Kaydet (Commit) dd50cb74 authored tarafından Tim Peters's avatar Tim Peters

The attempt to shut up deprecation warnings for doctest's own use of

is_private in its tests failed if doctest.py was run directly.  Now
it works.
üst 4de7c5c1
...@@ -220,6 +220,11 @@ import unittest, difflib, pdb, tempfile ...@@ -220,6 +220,11 @@ import unittest, difflib, pdb, tempfile
import warnings import warnings
from StringIO import StringIO 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 real_pdb_set_trace = pdb.set_trace
# There are 4 basic classes: # There are 4 basic classes:
...@@ -287,8 +292,6 @@ def is_private(prefix, base): ...@@ -287,8 +292,6 @@ def is_private(prefix, base):
Return true iff base begins with an (at least one) underscore, but Return true iff base begins with an (at least one) underscore, but
does not both begin and end with (at least) two underscores. 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") >>> is_private("a.b", "my_func")
False False
>>> is_private("____", "_my_func") >>> is_private("____", "_my_func")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment