no unbound methods in py3

--HG--
branch : trunk
This commit is contained in:
Benjamin Peterson 2009-08-29 16:22:34 -05:00
parent ee17858cce
commit 04dd0810c3
1 changed files with 5 additions and 1 deletions

View File

@ -348,8 +348,12 @@ class TestGenfuncFunctional:
def test_method(self, metafunc):
assert metafunc.config == py.test.config
assert metafunc.module.__name__ == __name__
if py.std.sys.version_info > (3, 0):
unbound = TestClass.test_method
else:
unbound = TestClass.test_method.im_func
# XXX actually have an unbound test function here?
assert metafunc.function == TestClass.test_method.im_func
assert metafunc.function == unbound
assert metafunc.cls == TestClass
""")
result = testdir.runpytest(p, "-v")