Skip to content

Commit

Permalink
TST: Try the other focus tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellister-slac committed Jul 6, 2023
1 parent df84dcf commit 282e4c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pydm/tests/widgets/test_lineedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,9 @@ def test_set_display(qtbot, qapp, value, has_focus, channel_type, display_format
pydm_lineedit.check_enable_state()

if has_focus:
pydm_lineedit.setFocus()
def wait_focus():
pydm_lineedit.setFocus()
qapp.processEvents()
return pydm_lineedit.hasFocus()

qtbot.waitUntil(wait_focus, timeout=5000)
Expand Down Expand Up @@ -590,6 +591,8 @@ def test_focus_in_event(qtbot, qapp, displayed_value, focus_reason, expected_foc

def wait_focus(focus_state):
""" Verify the current focus state of the line edit """
if focus_state:
pydm_lineedit.setFocus(Qt.OtherFocusReason)
qapp.processEvents()
return pydm_lineedit.hasFocus() == focus_state

Expand Down

0 comments on commit 282e4c1

Please sign in to comment.