Show More
@@ -4,7 +4,6 b' Test for async helpers.' | |||||
4 | Should only trigger on python 3.5+ or will have syntax errors. |
|
4 | Should only trigger on python 3.5+ or will have syntax errors. | |
5 | """ |
|
5 | """ | |
6 | from itertools import chain, repeat |
|
6 | from itertools import chain, repeat | |
7 | import nose.tools as nt |
|
|||
8 | from textwrap import dedent, indent |
|
7 | from textwrap import dedent, indent | |
9 | from unittest import TestCase |
|
8 | from unittest import TestCase | |
10 | from IPython.testing.decorators import skip_without |
|
9 | from IPython.testing.decorators import skip_without | |
@@ -24,10 +23,10 b' from IPython.core.async_helpers import _should_be_async' | |||||
24 |
|
23 | |||
25 | class AsyncTest(TestCase): |
|
24 | class AsyncTest(TestCase): | |
26 | def test_should_be_async(self): |
|
25 | def test_should_be_async(self): | |
27 |
|
|
26 | self.assertFalse(_should_be_async("False")) | |
28 |
|
|
27 | self.assertTrue(_should_be_async("await bar()")) | |
29 |
|
|
28 | self.assertTrue(_should_be_async("x = await bar()")) | |
30 |
|
|
29 | self.assertFalse( | |
31 | _should_be_async( |
|
30 | _should_be_async( | |
32 | dedent( |
|
31 | dedent( | |
33 | """ |
|
32 | """ | |
@@ -298,7 +297,7 b' class AsyncTest(TestCase):' | |||||
298 | import asyncio |
|
297 | import asyncio | |
299 | await asyncio.sleep(0) |
|
298 | await asyncio.sleep(0) | |
300 | """) |
|
299 | """) | |
301 |
with |
|
300 | with self.assertRaises(TypeError): | |
302 | res.raise_error() |
|
301 | res.raise_error() | |
303 |
|
302 | |||
304 | @skip_without('trio') |
|
303 | @skip_without('trio') | |
@@ -308,7 +307,7 b' class AsyncTest(TestCase):' | |||||
308 | import trio |
|
307 | import trio | |
309 | await trio.sleep(0) |
|
308 | await trio.sleep(0) | |
310 | """) |
|
309 | """) | |
311 |
with |
|
310 | with self.assertRaises(RuntimeError): | |
312 | res.raise_error() |
|
311 | res.raise_error() | |
313 |
|
312 | |||
314 |
|
313 |
General Comments 0
You need to be logged in to leave comments.
Login now