enthought / enthought/traitsui

wx Custom Button Editor DisplayedText Query not working?

Open
#1,654 0 comments 0 reactions 0 assignees View on GitHub
component: test suite priority: low toolkit: WxPython4
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Currently a test is failing on wx:
```
======================================================================
FAIL: test_custom_button_editor (traitsui.tests.editors.test_button_editor.TestButtonEditor)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/aayres/Desktop/traitsui/traitsui/tests/editors/test_button_editor.py", line 112, in test_custom_button_editor
self.check_button_text_update(custom_view)
File "/Users/aayres/Desktop/traitsui/traitsui/tests/editors/test_button_editor.py", line 96, in check_button_text_update
self.assertEqual(actual, "I'm a play button")
AssertionError: '' != "I'm a play button"
+ I'm a play button

----------------------------------------------------------------------
```

The relevant code for DisplayedText in UITester is here:
https://github.com/enthought/traitsui/blob/f7fa4b48d2223d60e1e3327bda2bf7501b0fba8e/traitsui/testing/tester/_ui_tester_registry/wx/_traitsui/button_editor.py#L78-L82
printing the control in the test, I see that with custom style it is ``, and with simple ``. wx Windows do have a `GetLabel` method as well, but for some reason this is giving `""` here, as opposed to "I'm a play button".

Calling `configure_traits in the test on wx gives:
Screen Shot 2021-05-07 at 10 26 53 AM

So it does appear that the displayed text is correct. Hence my suspicion this issue stems from UITester.

Current plan is to skip the test on. wx for now and leave this issue open as I am currently trying to clean up wx CI.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.