enable icon indicating copy to clipboard operation
enable copied to clipboard

Test fails with celiagg backend on windows

Open rahulporuri opened this issue 4 years ago • 0 comments

Running the enable testsuite after setting ETS_TOOLKIT="qt.celiagg" makes one test fail. Note that this failure isn't observed with the agg backend.

======================================================================
ERROR: test_bad_image_shape (enable.tests.test_kiva_graphics_context.TestGCErrors)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\rporuri\.edm\envs\enable-test\lib\site-packages\PIL\Image.py", line 2749, in fromarray
    mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 1), '|u1')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\rporuri\.edm\envs\enable-test\lib\site-packages\enable\tests\test_kiva_graphics_context.py", line 25, in test_bad_image_shape
    self.assertRaises(ValueError, gc.draw_image, arr.reshape(2, 2, 1))
  File "C:\Users\rporuri\.edm\envs\enable-test\lib\unittest\case.py", line 733, in assertRaises
    return context.handle('assertRaises', args, kwargs)
  File "C:\Users\rporuri\.edm\envs\enable-test\lib\unittest\case.py", line 178, in handle
    callable_obj(*args, **kwargs)
  File "C:\Users\rporuri\.edm\envs\enable-test\lib\site-packages\kiva\celiagg.py", line 584, in draw_image
    img = Image.fromarray(img)
  File "C:\Users\rporuri\.edm\envs\enable-test\lib\site-packages\PIL\Image.py", line 2751, in fromarray
    raise TypeError("Cannot handle this data type: %s, %s" % typekey) from e
TypeError: Cannot handle this data type: (1, 1, 1), |u1

rahulporuri avatar Jun 15 '21 10:06 rahulporuri