summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-04 01:32:50 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-01-04 01:32:50 +0100
commitde47cee545996b8e939a49c8363aa2cb572176fe (patch)
treee08b4f6bb91de2aafd8aa91affe09c3654ff7736
parent2ee1521e863ef37af696fafb213f5d8875834a76 (diff)
downloadtrollius-de47cee545996b8e939a49c8363aa2cb572176fe.tar.gz
Fix test_tasks failures
-rw-r--r--tests/test_tasks.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_tasks.py b/tests/test_tasks.py
index 43d37b1..55bb56f 100644
--- a/tests/test_tasks.py
+++ b/tests/test_tasks.py
@@ -108,7 +108,6 @@ class TaskTests(unittest.TestCase):
def test_task_repr(self):
@tasks.coroutine
def notmuch():
- yield []
raise tasks.Return('abc')
t = tasks.Task(notmuch(), loop=self.loop)
@@ -985,7 +984,7 @@ class TaskTests(unittest.TestCase):
test_utils.run_briefly(self.loop)
self.assertIs(res, non_local['result'])
self.assertTrue(t.done())
- self.assertIsNone(t.non_local['result']())
+ self.assertIsNone(t.result())
def test_step_with_baseexception(self):
@tasks.coroutine
@@ -1027,7 +1026,11 @@ class TaskTests(unittest.TestCase):
task.cancel()
self.assertFalse(task.done())
- self.assertRaises(BaseException, test_utils.run_briefly, loop)
+ def run_briefly(loop):
+ # FIXME: why should it be called twice?
+ test_utils.run_briefly(loop)
+ test_utils.run_briefly(loop)
+ self.assertRaises(BaseException, run_briefly, loop)
self.assertTrue(task.done())
self.assertFalse(task.cancelled())