diff --git a/tests/test_dzira.py b/tests/test_dzira.py index 8b8c73d..2faf01d 100644 --- a/tests/test_dzira.py +++ b/tests/test_dzira.py @@ -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) @@ -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()