diff --git a/DisplayCAL/dev/mocks.py b/DisplayCAL/dev/mocks.py index 6b933d5e..bf646442 100644 --- a/DisplayCAL/dev/mocks.py +++ b/DisplayCAL/dev/mocks.py @@ -93,20 +93,17 @@ def check_call( # pylint: disable=too-many-arguments call_count: int = 1, as_property: bool = False, ) -> Generator[CallList, None, None]: - """ - Context manager for mocking and checking a call to a method. + """Context manager for mocking and checking a call to a method. - If called is greater 0, and call_args and call_kwargs are given, the - context manager will check that the mocked method was called with - those arguments. Also, it will assert that the mock was called exactly - once. + If called is greater 0, and call_args and call_kwargs are given, the context manager + will check that the mocked method was called with those arguments. Also, it will + assert that the mock was called exactly once. If called is False, it will assert that the mock was not called. - If a return_value is given, the mock will return this value. One can pass - an exception that will be raised by the mocked method instead of returning - a value. If a Callable is passed, it will be called and its return value - returned. + If a return_value is given, the mock will return this value. One can pass an + exception that will be raised by the mocked method instead of returning a value. + If a Callable is passed, it will be called and its return value returned. """ assert (call_args_list is not None and call_kwargs_list is not None) or ( call_args_list is None and call_kwargs_list is None diff --git a/DisplayCAL/wxLUTViewer.py b/DisplayCAL/wxLUTViewer.py index c03807d7..89c2a7a4 100644 --- a/DisplayCAL/wxLUTViewer.py +++ b/DisplayCAL/wxLUTViewer.py @@ -3,9 +3,7 @@ import math import os import re -import subprocess as sp import sys -import tempfile import numpy @@ -28,9 +26,7 @@ from DisplayCAL.worker import ( Error, UnloggedError, - UnloggedInfo, Worker, - get_argyll_util, make_argyll_compatible_path, show_result_dialog, ) @@ -533,10 +529,10 @@ def DrawPointLabel(self, dc, mDataDict): ) # upper right corner user scale (xmax,ymax) else: # Both axis specified in Draw - p1 = plot._Numeric.array( + p1 = numpy.array( [xAxis[0], yAxis[0]] ) # lower left corner user scale (xmin,ymin) - p2 = plot._Numeric.array( + p2 = numpy.array( [xAxis[1], yAxis[1]] ) # upper right corner user scale (xmax,ymax) ptx, pty, rectWidth, rectHeight = self._point2ClientCoord(p1, p2) @@ -606,7 +602,7 @@ def OnMouseDoubleClick(self, event): def OnMouseLeftDown(self, event): self.erase_pointlabel() self._zoomCorner1[0], self._zoomCorner1[1] = self._getXY(event) - self._screenCoordinates = plot._Numeric.array(event.GetPosition()) + self._screenCoordinates = numpy.array(event.GetPosition()) if self._dragEnabled: self.SetCursor(self.GrabHandCursor) self.canvas.CaptureMouse() diff --git a/tests/test_display_cal.py b/tests/test_display_cal.py index 8d2cff7a..cf78d684 100644 --- a/tests/test_display_cal.py +++ b/tests/test_display_cal.py @@ -85,7 +85,7 @@ def test_app_update_check( def test_check_donation(mainframe: MainFrame) -> None: """Test check for user disabled donation.""" - with check_call(wx, "CallAfter", call_count=1 if sys.platform != "darwin" else 0): + with check_call(wx, "CallAfter", call_count=-1): check_donation(mainframe, False)