enthought / enthought/traitsui

wx test failure test_default_factory

Open
#1,653 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

With wx CI being an allowed failure, this slipped through #1634

traceback:
```
======================================================================
ERROR: test_default_factory (traitsui.tests.editors.test_list_editor.TestSimpleListEditor)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/aayres/Desktop/traitsui/traitsui/tests/editors/test_list_editor.py", line 230, in test_default_factory
dirs_list_editor._target.add_empty()
File "/Users/aayres/Desktop/traitsui/traitsui/wx/list_editor.py", line 383, in add_empty
list, index = self.get_info()
File "/Users/aayres/Desktop/traitsui/traitsui/wx/list_editor.py", line 313, in get_info
proxy = self._cur_control.proxy
AttributeError: 'ImageControl' object has no attribute 'proxy'

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

I am not sure it is actually directly related to the code from that PR (possibly the code path had just not been exercised previously)

The code is a little confusing in `wx/list_editor.py`. There is multiple `control` variables, `pcontrol`, `self.control`, `self._cur_control` all floating around. It seems things at some point are out of sync somewhere. I see code which sets `control.proxy = ___` where `control` is an 'ImageControl' object. It seems `self._cur_control` isn't being set to that `control` that gets a `proxy` assigned though?
I am not sure this is speculation based on a few minutes looking at it.

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.