Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
1f8d34c4
Commit
1f8d34c4
authored
May 19, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__threading_native_before_monkey was depending on a side-effect.
parent
4e00a77c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
src/gevent/testing/leakcheck.py
src/gevent/testing/leakcheck.py
+1
-0
src/gevent/tests/test__threading_native_before_monkey.py
src/gevent/tests/test__threading_native_before_monkey.py
+13
-2
No files found.
src/gevent/testing/leakcheck.py
View file @
1f8d34c4
...
...
@@ -207,6 +207,7 @@ def wrap_refcount(method):
self
.
skipTest
(
"This method ignored during leakchecks"
)
return
_method_skipped_during_leakcheck
@
wraps
(
method
)
def
wrapper
(
self
,
*
args
,
**
kwargs
):
# pylint:disable=too-many-branches
if
getattr
(
self
,
'ignore_leakcheck'
,
False
):
...
...
src/gevent/tests/test__threading_native_before_monkey.py
View file @
1f8d34c4
...
...
@@ -23,10 +23,17 @@ native_thread = None
class
Test
(
greentest
.
TestCase
):
@
classmethod
def
tearDownClass
(
cls
):
global
native_thread
if
native_thread
is
not
None
:
native_thread
.
stop
(
1
)
native_thread
=
None
def
test_main_thread
(
self
):
current
=
threading
.
current_thread
()
self
.
assert
False
(
isinstance
(
current
,
threading
.
_DummyThread
)
)
self
.
assert
True
(
isinstance
(
current
,
monkey
.
get_original
(
'threading'
,
'Thread'
)
))
self
.
assert
NotIsInstance
(
current
,
threading
.
_DummyThread
)
self
.
assert
IsInstance
(
current
,
monkey
.
get_original
(
'threading'
,
'Thread'
))
# in 3.4, if the patch is incorrectly done, getting the repr
# of the thread fails
repr
(
current
)
...
...
@@ -36,6 +43,9 @@ class Test(greentest.TestCase):
@
greentest
.
ignores_leakcheck
# because it can't be run multiple times
def
test_join_native_thread
(
self
):
if
native_thread
is
None
or
not
native_thread
.
do_run
:
# pragma: no cover
self
.
skipTest
(
"native_thread already closed"
)
self
.
assertTrue
(
native_thread
.
is_alive
())
native_thread
.
stop
(
timeout
=
1
)
...
...
@@ -48,6 +58,7 @@ class Test(greentest.TestCase):
if
__name__
==
'__main__'
:
native_thread
=
NativeThread
()
native_thread
.
daemon
=
True
native_thread
.
start
()
# Only patch after we're running
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment