Skip to content

Commit

Permalink
Add QApplication.processEvents to test_missing_cross_section
Browse files Browse the repository at this point in the history
Ensure UI updates are processed during the test execution. This change is necessary for the QApplication to handle pending events, which ensures the test reflects accurate UI behavior.

Signed-off-by: Jose Borreguero <[email protected]>
  • Loading branch information
jmborr committed Oct 25, 2024
1 parent 3414903 commit fdc8bf7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/ui/test_missing_cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# third party imports
import numpy as np
import pytest
from qtpy.QtWidgets import QApplication

# standard library imports

Expand Down Expand Up @@ -33,6 +34,7 @@ def test_missing_cross_section(qtbot):
# check the x vs TOF plot has changed
intensity_on_on = np.sum(ui_utilities.data_from_plot2D(main_window.xtof_overview))
assert intensity_on_on / intensity_off_on < TEST_REFLECTIVITY_THRESHOLD_VALUE
QApplication.processEvents()
del main_window


Expand Down

0 comments on commit fdc8bf7

Please sign in to comment.