Skip to content

Commit 70073ed

Browse files
authored
Merge pull request #902 from blink1073/fix-cell-id
2 parents e8ffc9e + f313e44 commit 70073ed

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

ipykernel/inprocess/tests/test_kernel.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) IPython Development Team.
22
# Distributed under the terms of the Modified BSD License.
33

4+
import asyncio
45
import sys
56
import unittest
67
from contextlib import contextmanager
@@ -148,3 +149,8 @@ def test_getpass_stream(self):
148149
kernel._input_request = lambda *args, **kwargs: None
149150

150151
kernel.getpass(stream="non empty")
152+
153+
def test_do_execute(self):
154+
kernel = InProcessKernel()
155+
asyncio.run(kernel.do_execute("a=1", True))
156+
assert kernel.shell.user_ns["a"] == 1

ipykernel/ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ async def do_execute(
304304
user_expressions=None,
305305
allow_stdin=False,
306306
*,
307-
cell_id,
307+
cell_id=None,
308308
):
309309
shell = self.shell # we'll need this a lot here
310310

ipykernel/kernelbase.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,14 @@ async def execute_request(self, stream, ident, parent):
749749
self._abort_queues()
750750

751751
def do_execute(
752-
self, code, silent, store_history=True, user_expressions=None, allow_stdin=False
752+
self,
753+
code,
754+
silent,
755+
store_history=True,
756+
user_expressions=None,
757+
allow_stdin=False,
758+
*,
759+
cell_id=None,
753760
):
754761
"""Execute user code. Must be overridden by subclasses."""
755762
raise NotImplementedError

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ tag_template = "v{new_version}"
3030
src = "ipykernel/_version.py"
3131

3232
[tool.pytest.ini_options]
33-
addopts = "-raXs --durations 10 --color=yes --doctest-modules"
33+
addopts = "-raXs --durations 10 --color=yes --doctest-modules --ignore=ipykernel/pylab/backend_inline.py --ignore=ipykernel/pylab/config.py --ignore=ipykernel/gui/gtk3embed.py --ignore=ipykernel/gui/gtkembed.py --ignore=ipykernel/datapub.py --ignore=ipykernel/log.py --ignore=ipykernel/pickleutil.py --ignore=ipykernel/serialize.py --ignore=ipykernel/_eventloop_macos.py"
3434
testpaths = [
35-
"ipykernel/tests/"
35+
"ipykernel/"
3636
]
3737
timeout = 300
3838
# Restore this setting to debug failures
@@ -41,6 +41,12 @@ filterwarnings= [
4141
# Fail on warnings
4242
"error",
4343

44+
# Ignore our own warnings
45+
"ignore:The `stream` parameter of `getpass.getpass` will have no effect:UserWarning",
46+
47+
# https://github.com/minrk/appnope/issues/13
48+
"ignore:distutils Version classes are deprecated:DeprecationWarning:appnope",
49+
4450
# Ignore jupyter_client warnings
4551
"ignore:unclosed <socket.socket:ResourceWarning",
4652
"ignore:unclosed event loop:ResourceWarning",

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def run(self):
8181
"ipyparallel",
8282
"pre-commit",
8383
"pytest-timeout",
84+
"gobject",
85+
"trio",
8486
],
8587
},
8688
classifiers=[

0 commit comments

Comments
 (0)