Skip to content
Snippets Groups Projects
Commit f5972235 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Weakfuncref test

parent d6f1efab
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,19 @@ def make_weakfuncref_method_that_will_get_gcd():
def method(self):
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():
......@@ -43,11 +55,11 @@ def test_weakfuncref_method():
return 'existent!'
def __priv_method(self):
return 'existent!'
return 'existent!'
@classmethod
def clsmethod(clsself):
return 'existent!'
return 'existent!'
t = Thing()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment