Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions tests/tools/svm/svm_calculator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,20 +308,26 @@ def fake_wait_key(_delay):
return 0
return 27

with patch("fezrs.tools.svm.svm_calculator.cv2.namedWindow"):
with patch(
"fezrs.tools.svm.svm_calculator.cv2.setMouseCallback",
fake_set_mouse_callback,
):
with patch("fezrs.tools.svm.svm_calculator.cv2.imshow"):
with patch(
"fezrs.tools.svm.svm_calculator.cv2.waitKey",
fake_wait_key,
):
# The GUI is fully mocked here, so the display check must be forced on:
# otherwise these tests pass on a workstation and fail on headless CI.
with patch(
"fezrs.tools.svm.svm_calculator.display_is_available",
return_value=True,
):
with patch("fezrs.tools.svm.svm_calculator.cv2.namedWindow"):
with patch(
"fezrs.tools.svm.svm_calculator.cv2.setMouseCallback",
fake_set_mouse_callback,
):
with patch("fezrs.tools.svm.svm_calculator.cv2.imshow"):
with patch(
"fezrs.tools.svm.svm_calculator.cv2.destroyAllWindows"
"fezrs.tools.svm.svm_calculator.cv2.waitKey",
fake_wait_key,
):
calculator.process()
with patch(
"fezrs.tools.svm.svm_calculator.cv2.destroyAllWindows"
):
calculator.process()


def test_nonsquare_training_samples_use_opencv_xy_as_numpy_yx():
Expand Down
Loading