Skip to content

Commit

Permalink
Add processEvents for linux failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FillBk committed Apr 11, 2024
1 parent 1338a68 commit 3ba062d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions test/asammdf/gui/widgets/test_PlotWidget_Shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ def test_Plot_Plot_Shortcut_Keys_Alt_R_Alt_S(self):
expected_raw_value = float(phys_value) / self.channels[0].signal.conversion.a
# Press "Alt+R"
QTest.keySequence(self.plot, QKeySequence(self.shortcuts["raw_samples"]))
for _ in range(50):
self.processEvents()
self.processEvents(1)
# Evaluate
# Signal mode = raw
self.assertEqual(self.channels[0].mode, "raw")
Expand All @@ -286,6 +285,7 @@ def test_Plot_Plot_Shortcut_Keys_Alt_R_Alt_S(self):

# Press "Alt+S"
QTest.keySequence(self.plot, QKeySequence(self.shortcuts["scaled_samples"]))
self.processEvents(1)
# Evaluate
# Signal mode = raw
self.assertEqual(self.channels[0].mode, "phys")
Expand Down Expand Up @@ -588,8 +588,7 @@ def test_Plot_Plot_Shortcut_Key_Ctrl_R(self):
# add channels to plot
self.assertIsNotNone(self.add_channels([35]))

self.widget.showMaximized()
self.processEvents()
self.processEvents(0.01)
if self.plot.selected_channel_value_btn.isFlat():
QTest.mouseClick(self.plot.selected_channel_value_btn, Qt.MouseButton.LeftButton)
self.mouseClick_WidgetItem(self.channels[0])
Expand Down Expand Up @@ -628,8 +627,7 @@ def test_Plot_Plot_Shortcut_Key_Ctrl_R(self):
mo_RangeEditor.assert_called()
self.assertEqual(self.channels[0].ranges, range_editor_result)

for _ in range(50):
self.processEvents(0.01)
self.processEvents(1)
self.avoid_blinking_issue(self.plot.channel_selection)

# Evaluate that plot has only Green and Red colors
Expand Down Expand Up @@ -691,8 +689,7 @@ def test_Plot_Plot_Shortcut_Key_Ctrl_R(self):
mo_ScaleDialog.return_value.exec.assert_called()
self.avoid_blinking_issue(self.plot.channel_selection)

for _ in range(50):
self.processEvents(0.01)
self.processEvents(1)
self.avoid_blinking_issue(self.plot.channel_selection)

self.assertTrue(Pixmap.has_color(self.plot.plot.grab(), red))
Expand All @@ -705,8 +702,7 @@ def test_Plot_Plot_Shortcut_Key_Ctrl_R(self):
self.assertEqual(mo_ScaleDialog.return_value.exec.call_count, 2)
self.avoid_blinking_issue(self.plot.channel_selection)

for _ in range(50):
self.processEvents()
self.processEvents(1)
self.avoid_blinking_issue(self.plot.channel_selection)

self.assertTrue(Pixmap.has_color(self.plot.plot.grab(), self.channels[0]))
Expand Down

0 comments on commit 3ba062d

Please sign in to comment.