summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart van Merrienboer <bart.vanmerrienboer@gmail.com>2015-01-21 12:51:23 -0500
committerBart van Merrienboer <bart.vanmerrienboer@gmail.com>2015-01-21 12:51:23 -0500
commitce2b04e7da617ae039a85c56fe3e9ff3e118feb0 (patch)
treea1432d1ea8f8052941d59d49f62d172b01be0618
parent0170e0da2fa711b74bcfb87dbb1faf02461b5cc2 (diff)
downloadsix-create_unbound_method.tar.gz
-rw-r--r--test_six.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test_six.py b/test_six.py
index 76a8ccb..73a1f41 100644
--- a/test_six.py
+++ b/test_six.py
@@ -456,6 +456,20 @@ def test_create_bound_method():
assert b() is x
+def test_create_unbound_method():
+ class X(object):
+ pass
+
+ def f(self):
+ return self
+ u = six.create_unbound_method(f, X)
+ py.test.raises(TypeError, u)
+ if six.PY2:
+ assert isinstance(u, types.MethodType)
+ x = X()
+ assert f(x) is x
+
+
if six.PY3:
def test_b():