Skip to content

wxAssertionError "GetEventHandler() == this" in test interaction #843

@ievacerny

Description

@ievacerny

First test that processes GUI events (gui.process_events()) and runs after test_tabular_editor.py, test_liststr_editor_selection.py or test_range_editor_spinner.py fails with wxAssertionError. I have encountered this with tests for SetEditor (added in #838)

Traceback (most recent call last):
  File "/Users/icernyte/Documents/repos/traitsui/traitsui/tests/problematic_editors/test_set_editor.py", line 588, in test_simple_set_editor_cant_move_all_button_existence
    ListModel(), get_view(can_move_all=False)
  File "/Users/icernyte/Documents/repos/traitsui/traitsui/tests/problematic_editors/test_set_editor.py", line 261, in setup_gui
    gui.process_events()
  File "/Users/icernyte/.edm/envs/traitsui-test-3.6-wx/lib/python3.6/site-packages/pyface/ui/wx/gui.py", line 79, in process_events
    wx.GetApp().Yield(True)
wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at /Users/robind/projects/bb2/dist-osx-py36/build/ext/wxWidgets/src/common/wincmn.cpp(475) in ~wxWindowBase(): any pushed event handlers must have b
een removed

Just one test from these test modules is enough to cause problems. Some of them are missing ui.dispose() but adding it doesn't help. The editors or the tests might not be doing some other clean up that is necessary after calling edit_traits() with these specific editors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions