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
c456b6ca
Commit
c456b6ca
authored
Nov 08, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert and rename more tests.
parent
c674216c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
37 deletions
+45
-37
src/gevent/testing/testcase.py
src/gevent/testing/testcase.py
+1
-1
src/gevent/tests/test__issue112.py
src/gevent/tests/test__issue112.py
+19
-0
src/gevent/tests/test__monkey_queue.py
src/gevent/tests/test__monkey_queue.py
+3
-1
src/gevent/tests/test__threading_2.py
src/gevent/tests/test__threading_2.py
+18
-24
src/gevent/tests/test_issue112.py
src/gevent/tests/test_issue112.py
+0
-8
src/gevent/tests/tests_that_dont_do_leakchecks.txt
src/gevent/tests/tests_that_dont_do_leakchecks.txt
+1
-0
src/gevent/tests/tests_that_dont_use_resolver.txt
src/gevent/tests/tests_that_dont_use_resolver.txt
+3
-3
No files found.
src/gevent/testing/testcase.py
View file @
c456b6ca
...
...
@@ -68,7 +68,7 @@ class TimeAssertMixin(object):
def
runs_in_no_time
(
self
,
fuzzy
=
(
0.0
0
1
if
not
sysinfo
.
EXPECT_POOR_TIMER_RESOLUTION
and
not
sysinfo
.
LIBUV
else
1.0
)):
fuzzy
=
(
0.01
if
not
sysinfo
.
EXPECT_POOR_TIMER_RESOLUTION
and
not
sysinfo
.
LIBUV
else
1.0
)):
return
self
.
runs_in_given_time
(
0.0
,
fuzzy
)
...
...
src/gevent/tests/test__issue112.py
0 → 100644
View file @
c456b6ca
import
sys
import
unittest
@
unittest
.
skipUnless
(
sys
.
version_info
[
0
]
==
2
,
"Only on Python 2"
)
class
Test
(
unittest
.
TestCase
):
def
test
(
self
):
import
threading
import
gevent.monkey
gevent
.
monkey
.
patch_all
()
import
gevent
self
.
assertIs
(
threading
.
_sleep
,
gevent
.
sleep
)
if
__name__
==
'__main__'
:
unittest
.
main
()
src/gevent/tests/test_queue.py
→
src/gevent/tests/test_
_monkey_
queue.py
View file @
c456b6ca
# Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
from
gevent
import
monkey
;
monkey
.
patch_all
()
from
gevent
import
monkey
monkey
.
patch_all
()
from
gevent
import
queue
as
Queue
import
threading
import
time
...
...
src/gevent/tests/test_threading_2.py
→
src/gevent/tests/test_
_
threading_2.py
View file @
c456b6ca
# testing gevent's Event, Lock, RLock, Semaphore, BoundedSemaphore with standard test_threading
from
__future__
import
print_function
from
gevent.testing.six
import
xrange
import
gevent.testing
as
greentest
...
...
@@ -29,10 +30,8 @@ setup_4 = '\n'.join(' %s' % line for line in setup_.split('\n'))
try
:
from
test
import
support
from
test.support
import
verbose
except
ImportError
:
from
test
import
test_support
as
support
from
test.test_support
import
verbose
import
random
import
re
...
...
@@ -50,6 +49,11 @@ import lock_tests
# A trivial mutable counter.
def
skipDueToHang
(
cls
):
return
unittest
.
skipIf
(
greentest
.
PYPY3
and
greentest
.
RUNNING_ON_CI
,
"SKIPPED: Timeout on PyPy3 on Travis"
)(
cls
)
class
Counter
(
object
):
def
__init__
(
self
):
...
...
@@ -97,7 +101,7 @@ class TestThread(threading.Thread):
print
(
'%s is finished. %d tasks are running'
%
(
self
.
name
,
self
.
nrunning
.
get
()))
@
skipDueToHang
class
ThreadTests
(
unittest
.
TestCase
):
# Create a bunch of threads, let each do some work, wait until all are
...
...
@@ -429,7 +433,7 @@ class ThreadTests(unittest.TestCase):
msg
=
(
'%d references still around'
%
sys
.
getrefcount
(
weak_raising_cyclic_object
())))
@
skipDueToHang
class
ThreadJoinOnShutdown
(
unittest
.
TestCase
):
def
_run_and_join
(
self
,
script
):
...
...
@@ -542,6 +546,7 @@ class ThreadJoinOnShutdown(unittest.TestCase):
self
.
_run_and_join
(
script
)
@
skipDueToHang
class
ThreadingExceptionTests
(
unittest
.
TestCase
):
# A RuntimeError should be raised if Thread.start() is called
# multiple times.
...
...
@@ -565,52 +570,41 @@ class ThreadingExceptionTests(unittest.TestCase):
self
.
assertRaises
(
RuntimeError
,
setattr
,
thread_
,
"daemon"
,
True
)
@
skipDueToHang
class
LockTests
(
lock_tests
.
LockTests
):
locktype
=
staticmethod
(
threading
.
Lock
)
@
skipDueToHang
class
RLockTests
(
lock_tests
.
RLockTests
):
locktype
=
staticmethod
(
threading
.
RLock
)
@
skipDueToHang
class
NativeRLockTests
(
lock_tests
.
RLockTests
):
# See comments at the top of the file for the difference
# between this and RLockTests, and why they both matter
locktype
=
staticmethod
(
threading
.
NativeRLock
)
@
skipDueToHang
class
EventTests
(
lock_tests
.
EventTests
):
eventtype
=
staticmethod
(
threading
.
Event
)
@
skipDueToHang
class
ConditionAsRLockTests
(
lock_tests
.
RLockTests
):
# An Condition uses an RLock by default and exports its API.
locktype
=
staticmethod
(
threading
.
Condition
)
@
skipDueToHang
class
ConditionTests
(
lock_tests
.
ConditionTests
):
condtype
=
staticmethod
(
threading
.
Condition
)
@
skipDueToHang
class
SemaphoreTests
(
lock_tests
.
SemaphoreTests
):
semtype
=
staticmethod
(
threading
.
Semaphore
)
@
skipDueToHang
class
BoundedSemaphoreTests
(
lock_tests
.
BoundedSemaphoreTests
):
semtype
=
staticmethod
(
threading
.
BoundedSemaphore
)
def
main
():
support
.
run_unittest
(
LockTests
,
RLockTests
,
EventTests
,
ConditionAsRLockTests
,
ConditionTests
,
SemaphoreTests
,
BoundedSemaphoreTests
,
ThreadTests
,
ThreadJoinOnShutdown
,
ThreadingExceptionTests
,
NativeRLockTests
,
)
if
__name__
==
"__main__"
:
if
greentest
.
PYPY3
and
greentest
.
RUNNING_ON_CI
:
print
(
"SKIPPED: Timeout on PyPy3 on Travis"
)
else
:
greentest
.
main
()
greentest
.
main
()
src/gevent/tests/test_issue112.py
deleted
100644 → 0
View file @
c674216c
import
sys
if
sys
.
version_info
[
0
]
==
2
:
import
threading
import
gevent.monkey
gevent
.
monkey
.
patch_all
()
import
gevent
assert
threading
.
_sleep
is
gevent
.
sleep
,
threading
.
_sleep
src/gevent/tests/tests_that_dont_do_leakchecks.txt
View file @
c456b6ca
...
...
@@ -6,3 +6,4 @@ test__ares_timeout.py
test__close_backend_fd.py
test__hub_join.py
test__hub_join_timeout.py
test__issue112.py
src/gevent/tests/tests_that_dont_use_resolver.txt
View file @
c456b6ca
...
...
@@ -33,7 +33,7 @@ test__greenletset.py
test__hub_join.py
test__hub_join_timeout.py
# uses socket test__hub.py
test_issue112.py
test_
_
issue112.py
test__joinall.py
test__local.py
test__loop_callback.py
...
...
@@ -45,7 +45,7 @@ test__os.py
test__pool.py
# uses socket test__pywsgi.py
test__queue.py
test_queue.py
test_
_monkey_
queue.py
# uses socket test__refcount.py
test__select.py
test__semaphore.py
...
...
@@ -62,7 +62,7 @@ test__signal.py
test__subprocess_interrupted.py
test__subprocess.py
test__systemerror.py
test_threading_2.py
test_
_
threading_2.py
test__threading_patched_local.py
test__threading_vs_settrace.py
test__threadpool.py
...
...
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