|
781 | 781 | "text/plain": [ |
782 | 782 | "[{'name': 'stdout',\n", |
783 | 783 | " 'output_type': 'stream',\n", |
784 | | - " 'text': ['CPU times: user 1 us, sys: 0 ns, total: 1 us\\n',\n", |
785 | | - " 'Wall time: 4.05 us\\n'],\n", |
| 784 | + " 'text': ['CPU times: user 2 us, sys: 1 us, total: 3 us\\n',\n", |
| 785 | + " 'Wall time: 4.29 us\\n'],\n", |
786 | 786 | " 'execution_count': None},\n", |
787 | 787 | " {'data': {'text/plain': ['2']},\n", |
788 | 788 | " 'metadata': {},\n", |
|
1025 | 1025 | "File <ipython-input-1-a5c3817716b6>:1\n", |
1026 | 1026 | "----> 1 import time; time.sleep(1.1)\n", |
1027 | 1027 | "\n", |
1028 | | - "Cell In[6], line 7, in run_cell.<locals>.handler(*args)\n", |
| 1028 | + "Cell In[143], line 7, in run_cell.<locals>.handler(*args)\n", |
1029 | 1029 | "----> 7 def handler(*args): raise TimeoutError()\n", |
1030 | 1030 | "\n", |
1031 | 1031 | "TimeoutError: \n", |
|
1064 | 1064 | "File <span class=\"ansi-green-fg\"><ipython-input-1-a5c3817716b6>:1</span>\n", |
1065 | 1065 | "<span class=\"ansi-green-fg\">----> 1</span> <span class=\"ansi-bold\" style=\"color: rgb(0,135,0)\">import</span> <span class=\"ansi-bold\" style=\"color: rgb(0,0,255)\">time</span>; time<span style=\"color: rgb(98,98,98)\">.</span>sleep(<span style=\"color: rgb(98,98,98)\">1.1</span>)\n", |
1066 | 1066 | "\n", |
1067 | | - "Cell <span class=\"ansi-green-fg\">In[6], line 7</span>, in <span class=\"ansi-cyan-fg\">run_cell.<locals>.handler</span><span class=\"ansi-blue-fg\">(*args)</span>\n", |
| 1067 | + "Cell <span class=\"ansi-green-fg\">In[143], line 7</span>, in <span class=\"ansi-cyan-fg\">run_cell.<locals>.handler</span><span class=\"ansi-blue-fg\">(*args)</span>\n", |
1068 | 1068 | "<span class=\"ansi-green-fg\">----> 7</span> <span class=\"ansi-bold\" style=\"color: rgb(0,135,0)\">def</span> <span style=\"color: rgb(0,0,255)\">handler</span>(<span style=\"color: rgb(98,98,98)\">*</span>args): <span class=\"ansi-bold\" style=\"color: rgb(0,135,0)\">raise</span> <span class=\"ansi-bold\" style=\"color: rgb(215,95,95)\">TimeoutError</span>()\n", |
1069 | 1069 | "\n", |
1070 | 1070 | "<span class=\"ansi-red-fg\">TimeoutError</span>: \n", |
|
1465 | 1465 | "[{'data': {'text/plain': ['<IPython.core.display.Markdown object>'],\n", |
1466 | 1466 | " 'text/markdown': [\"This is *bold*. Here's a [link](https://www.fast.ai).\"]},\n", |
1467 | 1467 | " 'metadata': {},\n", |
1468 | | - " 'output_type': 'execute_result'}]" |
| 1468 | + " 'output_type': 'execute_result',\n", |
| 1469 | + " 'execution_count': None}]" |
1469 | 1470 | ] |
1470 | 1471 | }, |
1471 | 1472 | "execution_count": null, |
|
1520 | 1521 | " 'File \\x1b[0;32m<ipython-input-1-1c97c1d317ab>:1\\x1b[0m\\n',\n", |
1521 | 1522 | " '\\x1b[0;32m----> 1\\x1b[0m \\x1b[38;5;28;01mraise\\x1b[39;00m \\x1b[38;5;167;01mException\\x1b[39;00m(\\x1b[38;5;124m\"\\x1b[39m\\x1b[38;5;124mOopsie!\\x1b[39m\\x1b[38;5;124m\"\\x1b[39m)\\n',\n", |
1522 | 1523 | " '\\n',\n", |
1523 | | - " '\\x1b[0;31mException\\x1b[0m: Oopsie!\\n']},\n", |
| 1524 | + " '\\x1b[0;31mException\\x1b[0m: Oopsie!\\n'],\n", |
| 1525 | + " 'execution_count': None},\n", |
1524 | 1526 | " {'ename': 'Exception',\n", |
1525 | 1527 | " 'evalue': 'Oopsie!',\n", |
1526 | 1528 | " 'output_type': 'error',\n", |
1527 | | - " 'traceback': 'Traceback (most recent call last):\\n File \"/Users/jhoward/miniconda3/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3577, in run_code\\n exec(code_obj, self.user_global_ns, self.user_ns)\\n File \"<ipython-input-1-1c97c1d317ab>\", line 1, in <module>\\n raise Exception(\"Oopsie!\")\\nException: Oopsie!\\n'}]" |
| 1529 | + " 'traceback': 'Traceback (most recent call last):\\n File \"/Users/jhoward/miniconda3/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3577, in run_code\\n exec(code_obj, self.user_global_ns, self.user_ns)\\n File \"<ipython-input-1-1c97c1d317ab>\", line 1, in <module>\\n raise Exception(\"Oopsie!\")\\nException: Oopsie!\\n',\n", |
| 1530 | + " 'execution_count': None}]" |
1528 | 1531 | ] |
1529 | 1532 | }, |
1530 | 1533 | "execution_count": null, |
|
1613 | 1616 | { |
1614 | 1617 | "data": { |
1615 | 1618 | "text/plain": [ |
1616 | | - "[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']},\n", |
| 1619 | + "[{'name': 'stdout',\n", |
| 1620 | + " 'output_type': 'stream',\n", |
| 1621 | + " 'text': ['1\\n'],\n", |
| 1622 | + " 'execution_count': None},\n", |
1617 | 1623 | " {'data': {'text/plain': ['2']},\n", |
1618 | 1624 | " 'metadata': {},\n", |
1619 | | - " 'output_type': 'execute_result'}]" |
| 1625 | + " 'output_type': 'execute_result',\n", |
| 1626 | + " 'execution_count': None}]" |
1620 | 1627 | ] |
1621 | 1628 | }, |
1622 | 1629 | "execution_count": null, |
|
1679 | 1686 | "name": "stdout", |
1680 | 1687 | "output_type": "stream", |
1681 | 1688 | "text": [ |
1682 | | - "[{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']}, {'data': {'text/plain': ['2']}, 'metadata': {}, 'output_type': 'execute_result'}]\n" |
| 1689 | + "[{'execution_count': None, 'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']}, {'data': {'text/plain': ['2']}, 'execution_count': None, 'metadata': {}, 'output_type': 'execute_result'}]\n" |
1683 | 1690 | ] |
1684 | 1691 | } |
1685 | 1692 | ], |
|
1741 | 1748 | "\n", |
1742 | 1749 | "While Executing Cell #2:\n", |
1743 | 1750 | "Traceback (most recent call last):\n", |
1744 | | - " File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_18616/1421292703.py\", line 3, in <module>\n", |
| 1751 | + " File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_6273/1421292703.py\", line 3, in <module>\n", |
1745 | 1752 | " s.execute('../tests/error.ipynb', exc_stop=True)\n", |
1746 | | - " File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_18616/3609882568.py\", line 18, in execute\n", |
| 1753 | + " File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_6273/3609882568.py\", line 18, in execute\n", |
1747 | 1754 | " self.run_all(nb, exc_stop=exc_stop, preproc=preproc, postproc=postproc,\n", |
1748 | | - " File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_18616/3068237356.py\", line 19, in run_all\n", |
| 1755 | + " File \"/var/folders/ss/34z569j921v58v8n1n_8z7h40000gn/T/ipykernel_6273/3068237356.py\", line 19, in run_all\n", |
1749 | 1756 | " if self.exc and exc_stop: raise self.exc from None\n", |
1750 | 1757 | " ^^^^^^^^^^^^^^^^^^^^^^^^\n", |
1751 | 1758 | " File \"/Users/jhoward/miniconda3/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3577, in run_code\n", |
|
1843 | 1850 | "#|hide\n", |
1844 | 1851 | "# `display_data` flushes stdout and stderr - in that order\n", |
1845 | 1852 | "res = CaptureShell().run(\"import sys; sys.stderr.write('Error!'); print(1); display(1)\")\n", |
1846 | | - "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']},\n", |
1847 | | - " {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!']},\n", |
1848 | | - " {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data'}])" |
| 1853 | + "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n'], 'execution_count': None},\n", |
| 1854 | + " {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!'], 'execution_count': None},\n", |
| 1855 | + " {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data', 'execution_count': None}])" |
1849 | 1856 | ] |
1850 | 1857 | }, |
1851 | 1858 | { |
|
1857 | 1864 | "#|hide\n", |
1858 | 1865 | "# Consecutive writes to stdout are grouped\n", |
1859 | 1866 | "res = CaptureShell().run('print(1); print(2); print(3)')\n", |
1860 | | - "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n']}])" |
| 1867 | + "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n'], 'execution_count': None}])" |
1861 | 1868 | ] |
1862 | 1869 | }, |
1863 | 1870 | { |
|
1869 | 1876 | "#|hide\n", |
1870 | 1877 | "# Consecutive writes to stdout are grouped despite an intermediate write to stderr, which is captured after\n", |
1871 | 1878 | "res = CaptureShell().run(\"import sys; print(1); print(2); sys.stderr.write('Error!'); print(3)\")\n", |
1872 | | - "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n']},\n", |
1873 | | - " {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!']}])" |
| 1879 | + "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n', '2\\n', '3\\n'], 'execution_count': None},\n", |
| 1880 | + " {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!'], 'execution_count': None}])" |
1874 | 1881 | ] |
1875 | 1882 | }, |
1876 | 1883 | { |
|
1882 | 1889 | "#|hide\n", |
1883 | 1890 | "# `execute_result` is always last\n", |
1884 | 1891 | "res = CaptureShell().run(\"import sys; sys.stderr.write('Error!'); print(1); display(1); 1\")\n", |
1885 | | - "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']},\n", |
1886 | | - " {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!']},\n", |
1887 | | - " {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data'},\n", |
1888 | | - " {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'execute_result'}])" |
| 1892 | + "test_eq(res, [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n'], 'execution_count': None},\n", |
| 1893 | + " {'name': 'stderr', 'output_type': 'stream', 'text': ['Error!'], 'execution_count': None},\n", |
| 1894 | + " {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'display_data', 'execution_count': None},\n", |
| 1895 | + " {'data': {'text/plain': ['1']}, 'metadata': {}, 'output_type': 'execute_result', 'execution_count': None}])" |
1889 | 1896 | ] |
1890 | 1897 | }, |
1891 | 1898 | { |
|
1947 | 1954 | " 'execution_count': None,\n", |
1948 | 1955 | " 'id': 'ea528db5',\n", |
1949 | 1956 | " 'metadata': {},\n", |
1950 | | - " 'outputs': [{'name': 'stdout', 'output_type': 'stream', 'text': ['2\\n']}],\n", |
| 1957 | + " 'outputs': [{'name': 'stdout',\n", |
| 1958 | + " 'output_type': 'stream',\n", |
| 1959 | + " 'text': ['2\\n'],\n", |
| 1960 | + " 'execution_count': None}],\n", |
1951 | 1961 | " 'source': 'print(a)',\n", |
1952 | 1962 | " 'idx_': 1}]" |
1953 | 1963 | ] |
|
0 commit comments