Skip to content

Commit c3e6c6b

Browse files
committed
Updates to manage mypy errors
1 parent f1b6871 commit c3e6c6b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

samples/magics/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import pytest
1919

2020
if typing.TYPE_CHECKING:
21-
from IPython.core.interactiveshell import TerminalInteractiveShell
21+
from IPython.terminal.interactiveshell import TerminalInteractiveShell
2222

2323
interactiveshell = pytest.importorskip("IPython.terminal.interactiveshell")
2424
tools = pytest.importorskip("IPython.testing.tools")
@@ -40,5 +40,6 @@ def ipython_interactive(
4040
4141
for the duration of the test scope.
4242
"""
43-
with ipython.builtin_trap:
44-
yield ipython
43+
if ipython.builtin_trap is not None:
44+
with ipython.builtin_trap:
45+
yield ipython

samples/notebooks/jupyter_tutorial_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def ipython_interactive(
4646
for the duration of the test scope.
4747
"""
4848

49-
if ipython.builtin_type is not None:
49+
if ipython.builtin_trap is not None:
5050
with ipython.builtin_trap:
5151
yield ipython
5252

samples/notebooks/noxfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def _session_tests(
231231

232232
session.run(
233233
"pytest",
234+
"-s",
234235
*(PYTEST_COMMON_ARGS + session.posargs + concurrent_args),
235236
# Pytest will return 5 when no tests are collected. This can happen
236237
# on travis where slow and flaky tests are excluded.

0 commit comments

Comments
 (0)