From 03a0d79306b2846313df1983a721d5cccf4ec3ce Mon Sep 17 00:00:00 2001 From: John Anderson Date: Fri, 26 Dec 2014 23:19:32 -0800 Subject: Clean up compat tests --- pyramid/tests/test_compat.py | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/pyramid/tests/test_compat.py b/pyramid/tests/test_compat.py index 2f80100dd..23ccce82e 100644 --- a/pyramid/tests/test_compat.py +++ b/pyramid/tests/test_compat.py @@ -1,46 +1,26 @@ import unittest +from pyramid.compat import is_unbound_method class TestUnboundMethods(unittest.TestCase): def test_old_style_bound(self): - from pyramid.compat import is_unbound_method - - class OldStyle: - def run(self): - return 'OK' - self.assertFalse(is_unbound_method(OldStyle().run)) def test_new_style_bound(self): - from pyramid.compat import is_unbound_method - - class NewStyle(object): - def run(self): - return 'OK' - self.assertFalse(is_unbound_method(NewStyle().run)) def test_old_style_unbound(self): - from pyramid.compat import is_unbound_method - - class OldStyle: - def run(self): - return 'OK' - self.assertTrue(is_unbound_method(OldStyle.run)) def test_new_style_unbound(self): - from pyramid.compat import is_unbound_method - - class NewStyle(object): - def run(self): - return 'OK' - self.assertTrue(is_unbound_method(NewStyle.run)) def test_normal_func_unbound(self): - from pyramid.compat import is_unbound_method - - def func(): - return 'OK' + def func(): return 'OK' self.assertFalse(is_unbound_method(func)) + +class OldStyle: + def run(self): return 'OK' + +class NewStyle(object): + def run(self): return 'OK' -- cgit v1.2.3