Skip to content

Commit

Permalink
#6 removed redundant patch
Browse files Browse the repository at this point in the history
  • Loading branch information
caseneuve committed Jan 27, 2024
1 parent d45dab2 commit 7438589
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/test_dzira.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,12 @@ def test_returns_string_without_color_tags_when_use_color_is_false(self, mocker)


class TestCursorHelpers:
def test_hides_cursor(self, mocker):
mock_print = mocker.patch("src.dzira.dzira.print")

def test_hides_cursor(self, mock_print):
hide_cursor()

mock_print.assert_called_once_with("\033[?25l", end="", flush=True, file=sys.stderr)

def test_shows_cursor(self, mocker):
mock_print = mocker.patch("src.dzira.dzira.print")

def test_shows_cursor(self, mock_print):
show_cursor()

mock_print.assert_called_once_with("\033[?25h", end="", flush=True, file=sys.stderr)
Expand Down Expand Up @@ -1652,13 +1648,12 @@ def test_runs_cli(self, mocker):

mock_cli.assert_called_once()

def test_catches_exceptions_and_exits(self, mocker):
def test_catches_exceptions_and_exits(self, mocker, mock_print):
mocker.patch("src.dzira.dzira.hide_cursor")
mocker.patch("src.dzira.dzira.show_cursor")
mock_cli = mocker.patch("src.dzira.dzira.cli")
exc = Exception("foo")
mock_cli.side_effect = exc
mock_print = mocker.patch("src.dzira.dzira.print")
mock_exit = mocker.patch("src.dzira.dzira.sys.exit")

main()
Expand Down

0 comments on commit 7438589

Please sign in to comment.