diff options
author | Bart van Merrienboer <bart.vanmerrienboer@gmail.com> | 2015-01-21 12:51:23 -0500 |
---|---|---|
committer | Bart van Merrienboer <bart.vanmerrienboer@gmail.com> | 2015-01-21 12:51:23 -0500 |
commit | ce2b04e7da617ae039a85c56fe3e9ff3e118feb0 (patch) | |
tree | a1432d1ea8f8052941d59d49f62d172b01be0618 /test_six.py | |
parent | 0170e0da2fa711b74bcfb87dbb1faf02461b5cc2 (diff) | |
download | six-create_unbound_method.tar.gz |
Added testscreate_unbound_method
Diffstat (limited to 'test_six.py')
-rw-r--r-- | test_six.py | 14 |
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(): |