summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-11-21 03:18:59 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-11-21 03:18:59 +0100
commit3df5acc6a83711473c45d4ec56b27b2daeb89bd6 (patch)
tree6cdfb492bc4a99cc215fdbed6279916b8ddb74d5 /tests
parent19391bbc96a7de41e082d54200b16e3f500335db (diff)
downloadaioeventlet-3df5acc6a83711473c45d4ec56b27b2daeb89bd6.tar.gz
call_soon() now detects automatically switch to call_soon_threadsafe() if
selector.select() is running. Similar change for call_at(): reschedule the call with call_soon_threadsafe() if selector.select() is running.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_eventlet.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_eventlet.py b/tests/test_eventlet.py
index a77f772..24c23f5 100644
--- a/tests/test_eventlet.py
+++ b/tests/test_eventlet.py
@@ -24,9 +24,9 @@ try:
try:
value = gt.wait()
except Exception as exc:
- loop.call_soon_threadsafe(fut.set_exception, exc)
+ loop.call_soon(fut.set_exception, exc)
else:
- loop.call_soon_threadsafe(fut.set_result, value)
+ loop.call_soon(fut.set_result, value)
gt.link(copy_result)
value = yield from fut
@@ -69,9 +69,9 @@ except ImportError:
try:
value = gt.wait()
except Exception as exc:
- loop.call_soon_threadsafe(fut.set_exception, exc)
+ loop.call_soon(fut.set_exception, exc)
else:
- loop.call_soon_threadsafe(fut.set_result, value)
+ loop.call_soon(fut.set_result, value)
gt.link(copy_result)
value = yield From(fut)
@@ -104,7 +104,7 @@ except ImportError:
class EventletTests(tests.TestCase):
def test_stop(self):
def func():
- eventlet.spawn(self.loop.call_soon_threadsafe, self.loop.stop)
+ eventlet.spawn(self.loop.call_soon, self.loop.stop)
def schedule_greenthread():
eventlet.spawn(func)
@@ -117,7 +117,7 @@ class EventletTests(tests.TestCase):
def func():
result.append("spawn")
- self.loop.call_soon_threadsafe(self.loop.stop)
+ self.loop.call_soon(self.loop.stop)
def schedule_greenthread():
eventlet.spawn(func)
@@ -134,7 +134,7 @@ class EventletTests(tests.TestCase):
def func2():
result.append("spawn_after")
- self.loop.call_soon_threadsafe(self.loop.stop)
+ self.loop.call_soon(self.loop.stop)
def schedule_greenthread():
eventlet.spawn(func1)