Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
f5972235
Commit
f5972235
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Weakfuncref test
parent
d6f1efab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_weakfuncref.py
+16
-4
16 additions, 4 deletions
tests/test_weakfuncref.py
with
16 additions
and
4 deletions
tests/test_weakfuncref.py
+
16
−
4
View file @
f5972235
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment