diff options
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 118ccf6..060a966 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(): |