Skip to content

Commit 4854752

Browse files
authored
Fix expected text depending on IPython version. (#1354)
1 parent b3a0999 commit 4854752

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_start_kernel.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414

1515
@flaky(max_runs=3)
1616
def test_ipython_start_kernel_userns():
17+
import IPython
18+
19+
if IPython.version_info > (9, 0): # noqa:SIM108
20+
EXPECTED = "IPythonMainModule"
21+
else:
22+
# not this since https://github.com/ipython/ipython/pull/14754
23+
EXPECTED = "DummyMod"
24+
1725
cmd = dedent(
1826
"""
1927
from ipykernel.kernelapp import launch_new_instance
@@ -40,7 +48,7 @@ def test_ipython_start_kernel_userns():
4048
content = msg["content"]
4149
assert content["found"]
4250
text = content["data"]["text/plain"]
43-
assert "DummyMod" in text
51+
assert EXPECTED in text
4452

4553

4654
@flaky(max_runs=3)

0 commit comments

Comments
 (0)