Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_layout_load fails with ETS master #471

Closed
mdickinson opened this issue Jun 7, 2022 · 3 comments · Fixed by #472
Closed

test_layout_load fails with ETS master #471

mdickinson opened this issue Jun 7, 2022 · 3 comments · Fixed by #472

Comments

@mdickinson
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

figure out what changed

From bisecting, the offending change appears to be this one in Traits: enthought/traits@d056140

@mdickinson
Copy link
Member Author

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.

mdickinson added a commit that referenced this issue Jun 7, 2022
This PR refreshes the two layout pickle files, by simply reading and then writing them again with Traits 6.3.2. This has the effect of changing the module used for importing TraitListObject from traits.trait_handlers to traits.trait_list_object.

I've also added a script that can be used to create the pickles directly if we need to do this again in the future.

Should fix #471.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant