summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/tests/test_compat.py36
1 files 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'