Show More
@@ -11,12 +11,18 b' import io' | |||||
11 | import os |
|
11 | import os | |
12 | import re |
|
12 | import re | |
13 |
|
13 | |||
|
14 | try: | |||
|
15 | from queue import Empty # Py 3 | |||
|
16 | except ImportError: | |||
|
17 | from Queue import Empty # Py 2 | |||
|
18 | ||||
14 | from IPython import nbformat |
|
19 | from IPython import nbformat | |
15 |
|
20 | |||
16 | from .base import PreprocessorTestsBase |
|
21 | from .base import PreprocessorTestsBase | |
17 | from ..execute import ExecutePreprocessor |
|
22 | from ..execute import ExecutePreprocessor | |
18 |
|
23 | |||
19 | from IPython.nbconvert.filters import strip_ansi |
|
24 | from IPython.nbconvert.filters import strip_ansi | |
|
25 | from nose.tools import assert_raises | |||
20 |
|
26 | |||
21 | addr_pat = re.compile(r'0x[0-9a-f]{7,9}') |
|
27 | addr_pat = re.compile(r'0x[0-9a-f]{7,9}') | |
22 |
|
28 | |||
@@ -135,3 +141,9 b' class TestExecute(PreprocessorTestsBase):' | |||||
135 | self.assertEqual(output['output_type'], 'error') |
|
141 | self.assertEqual(output['output_type'], 'error') | |
136 | self.assertEqual(output['ename'], 'StdinNotImplementedError') |
|
142 | self.assertEqual(output['ename'], 'StdinNotImplementedError') | |
137 | self.assertEqual(output['evalue'], 'raw_input was called, but this frontend does not support input requests.') |
|
143 | self.assertEqual(output['evalue'], 'raw_input was called, but this frontend does not support input requests.') | |
|
144 | ||||
|
145 | def test_timeout(self): | |||
|
146 | """Check that an error is raised when a computation times out""" | |||
|
147 | current_dir = os.path.dirname(__file__) | |||
|
148 | filename = os.path.join(current_dir, 'files', 'Interrupt.ipynb') | |||
|
149 | assert_raises(Empty, self.run_notebook, filename, dict(timeout=1)) |
General Comments 0
You need to be logged in to leave comments.
Login now