[svn r38459] two functions with the same name, use the latter one.

--HG--
branch : trunk
This commit is contained in:
hpk 2007-02-11 14:45:49 +01:00
parent 4e66510fa7
commit e068a463a1
1 changed files with 1 additions and 19 deletions

View File

@ -1,27 +1,9 @@
import py
def deprecated_call(func, *args, **kwargs):
def deprecated_call(func, *args, **kwargs):
""" assert that calling func(*args, **kwargs)
triggers a DeprecationWarning.
"""
oldfilters = py.std.warnings.filters[:]
onceregistry = py.std.warnings.onceregistry.copy()
try:
py.std.warnings.onceregistry.clear()
py.std.warnings.filterwarnings("error", category=DeprecationWarning)
try:
_ = func(*args, **kwargs)
except DeprecationWarning:
pass
else:
print __warningregistry__
raise AssertionError("%s not deprecated" % (func,))
finally:
py.std.warnings.filters[:] = oldfilters
py.std.warnings.onceregistry.clear()
py.std.warnings.onceregistry.update(onceregistry)
def deprecated_call(func, *args, **kwargs):
l = []
oldwarn = py.std.warnings.warn_explicit
def warn_explicit(*args, **kwargs):