enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 284 forks source link

Running the testsuite without a PyFace Toolkit shouldn't cause errors #1077

Open rahulporuri opened 2 years ago

rahulporuri commented 2 years ago

The following errors can be seen when the testsuite is run from an environment which does not contain a PyFace Toolkit -

======================================================================
ERROR: test_get_engine_backend_simple_with_existing_engine (mayavi.tests.test_engine_manager.TestEngineManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/unittest/mock.py", line 1183, in patched
    return func(*args, **keywargs)
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/mayavi/tests/test_engine_manager.py", line 40, in test_get_engine_backend_simple_with_existing_engine
    self.assertIs(type(get_engine()), Engine)
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/mayavi/tools/engine_manager.py", line 92, in get_engine
    return self.new_engine()
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/mayavi/tools/engine_manager.py", line 137, in new_engine
    check_backend()
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/mayavi/tools/engine_manager.py", line 40, in check_backend
    raise ImportError(msg)
ImportError: Could not import backend for traitsui.  Make sure you
        have a suitable UI toolkit like PyQt/PySide or wxPython
        installed.

======================================================================
ERROR: test_mlab_scene_model_with_gui (mayavi.tests.test_garbage_collection.TestMayaviGarbageCollection)
Tests if MlabSceneModel with GUI can be garbage collected.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/mayavi/tests/test_garbage_collection.py", line 23, in test_mlab_scene_model_with_gui
    class MlabApp(HasTraits):
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/mayavi/tests/test_garbage_collection.py", line 29, in MlabApp
    editor=SceneEditor(scene_class=MayaviScene),
  File "/Users/runner/hostedtoolcache/Python/3.6.15/x64/lib/python3.6/site-packages/pyface/base_toolkit.py", line 190, in __init__
    raise NotImplementedError(msg % (toolkit, package, name))
NotImplementedError: the null tvtk.pyface.ui.null backend doesn't implement scene_editor:SceneEditor

See the output of the GitHub Actions CI job - https://github.com/enthought/mayavi/runs/3774411113?check_suite_focus=true for reference.