enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
82 stars 26 forks source link

test_layout_load fails with ETS master #471

Closed mdickinson closed 2 years ago

mdickinson commented 2 years ago

The test_layout_load and test_layout_load tests fail with latest ETS packages; this is causing our CI cron job to fail. Here are the tracebacks:

======================================================================
FAIL: test_layout_load (envisage.ui.tasks.tests.test_tasks_application.TestTasksApplication)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/.edm/envs/envisage-test-3.6-pyside2/lib/python3.6/site-packages/envisage/ui/tasks/tests/test_tasks_application.py", line 83, in test_layout_load
    self.assertEqual(state.previous_window_layouts[0].size, (492, 743))
AssertionError: Tuples differ: (800, 600) != (492, 743)
First differing element 0:
800
492
- (800, 600)
+ (492, 743)
======================================================================
FAIL: test_layout_load_pickle_protocol_3 (envisage.ui.tasks.tests.test_tasks_application.TestTasksApplication)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/.edm/envs/envisage-test-3.6-pyside2/lib/python3.6/site-packages/envisage/ui/tasks/tests/test_tasks_application.py", line 109, in test_layout_load_pickle_protocol_3
    self.assertEqual(state.previous_window_layouts[0].size, (492, 743))
AssertionError: Tuples differ: (800, 600) != (492, 743)
First differing element 0:
800
492
- (800, 600)
+ (492, 743)
mdickinson commented 2 years ago

I can reproduce locally on macOS with python etstool.py install --toolkit=pyside2 --source followed by python etstool.py test --toolkit=pyside2. Investigating further to figure out what changed.

mdickinson commented 2 years ago

figure out what changed

From bisecting, the offending change appears to be this one in Traits: https://github.com/enthought/traits/commit/d056140bcd290992d91a86746ff103c3aa8e7e24

mdickinson commented 2 years ago

The cause was that the two pickle files we were using in tests expected to import TraitListObject from traits.trait_handlers instead of from its newer location of traits.trait_list_object. Traits PR enthought/traits#1634 removed the import of TraitListObject in traits.trait_handlers. The quick fix is simply to regenerate those pickle files.

We might want to consider keeping the trait_handlers imports, for the benefit of older pickles.