Skip to content

Commit

Permalink
Robustify ipdb_ctrl_bs import test
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Aug 13, 2024
1 parent a12672d commit 8815d44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_prompt_toolkit_ctrl_bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ def test_unneeded(self, mocker: MockerFixture, esc_seqs: MagicMock) -> None:
def test_ipdb_ctrl_bs(mocker: MockerFixture) -> None:
# mock out the patch function, as we've tested it above
mock_patch = mocker.patch("yut23_utils._prompt_toolkit_ctrl_bs.patch")
# undo imports when the test is finished
mocker.patch.dict("sys.modules")

# unload the module if it's been imported already
modules = mocker.patch.dict("sys.modules")
modules.pop("yut23_utils.ipdb_ctrl_bs", None)
# pylint: disable-next=import-outside-toplevel
from yut23_utils.ipdb_ctrl_bs import TerminalPdb

Expand Down

0 comments on commit 8815d44

Please sign in to comment.