Files
pytest2/testing/test_compat_deprecation.py
holger krekel c8119d89b6 move test files out of py lib proper
* separate all tests from plugins
* simplify implicit inclusion of plugins under test
* have test_initpkg perform direct checks instead of yielding tests
* fix example tests for 3k

--HG--
branch : trunk
2009-09-06 16:59:39 +02:00

18 lines
508 B
Python

def test_functional_deprecation(testdir):
testdir.makepyfile("""
import py
def test_compat_deprecations(recwarn):
for name in 'subprocess optparse textwrap doctest'.split():
check(recwarn, name)
def check(recwarn, name):
x = getattr(py.compat, name)
recwarn.pop(DeprecationWarning)
recwarn.clear()
assert x == getattr(py.std, name)
""")
result = testdir.runpytest()
assert result.ret == 0