Commit 318491b7 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Weakfuncref test

parent 5634900f
...@@ -21,7 +21,19 @@ def make_weakfuncref_method_that_will_get_gcd(): ...@@ -21,7 +21,19 @@ def make_weakfuncref_method_that_will_get_gcd():
def method(self): def method(self):
pass pass
return weakfuncref.WeakFunctionRef(Thing.method) return weakfuncref.WeakFunctionRef(Thing.method)
def test_weakfuncref_call():
def func():
pass
non_gcd_func = weakfuncref.WeakFunctionRef(func)
gcd_func = make_weakfuncref_that_will_get_gcd()
assert gcd_func() is None
assert non_gcd_func() is func
def test_weakfuncref_function(): def test_weakfuncref_function():
...@@ -43,11 +55,11 @@ def test_weakfuncref_method(): ...@@ -43,11 +55,11 @@ def test_weakfuncref_method():
return 'existent!' return 'existent!'
def __priv_method(self): def __priv_method(self):
return 'existent!' return 'existent!'
@classmethod @classmethod
def clsmethod(clsself): def clsmethod(clsself):
return 'existent!' return 'existent!'
t = Thing() t = Thing()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment