Commit 1f82df1f authored by Jason Madden's avatar Jason Madden

Fix test_threading --Event under new pypy standard lib. [skip appveyor]

parent b85732ec
......@@ -39,8 +39,12 @@ class Bunch(object):
self.finished.append(tid)
while not self._can_exit:
_wait()
for i in range(n):
start_new_thread(task, ())
try:
for i in range(n):
start_new_thread(task, ())
except:
self._can_exit = True
raise
def wait_for_started(self):
while len(self.started) < self.n:
......@@ -301,6 +305,16 @@ class EventTests(BaseTestCase):
for r, dt in results2:
self.assertTrue(r)
def test_reset_internal_locks(self):
evt = self.eventtype()
if not hasattr(evt, '_Event__cond') or sys.version_info[:3] <= (2, 7, 8):
self.skipTest("gevent: internal impl difference")
old_lock = evt._Event__cond._Condition__lock
evt._reset_internal_locks()
new_lock = evt._Event__cond._Condition__lock
self.assertIsNot(new_lock, old_lock)
self.assertIs(type(new_lock), type(old_lock))
class ConditionTests(BaseTestCase):
"""
......
......@@ -19,7 +19,7 @@ try:
except ImportError:
_testcapi = None
from test import lock_tests
import lock_tests # gevent: use local copy
# A trivial mutable counter.
class Counter(object):
......
Markdown is supported
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