diff --git a/setup.py b/setup.py index 0898a7b95..52172096c 100644 --- a/setup.py +++ b/setup.py @@ -302,6 +302,9 @@ def get_long_description(): ], "test": [ "Cython", + # defusedxml is required by the Sphinx test machinery + # for recent versions of Sphinx (including 7.3.7) + "defusedxml", "flake8", "flake8-ets", "mypy", diff --git a/traits/tests/test_enum.py b/traits/tests/test_enum.py index ff2e274bf..ea6a69d49 100644 --- a/traits/tests/test_enum.py +++ b/traits/tests/test_enum.py @@ -14,11 +14,8 @@ from traits.api import ( Any, BaseEnum, Enum, HasTraits, Int, List, Property, Set, TraitError, Tuple) -from traits.etsconfig.api import ETSConfig from traits.testing.optional_dependencies import requires_traitsui -is_null = ETSConfig.toolkit == 'null' - class FooEnum(enum.Enum): foo = 0 @@ -115,13 +112,6 @@ class EnumCollectionExample(HasTraits): slow_enum = BaseEnum("yes", "no", "maybe") -class EnumCollectionGUIExample(EnumCollectionExample): - # Override attributes that may fail GUI test - # until traitsui #781 is fixed. - int_set_enum = Enum("int", "set") - correct_int_set_enum = Enum("int", "set") - - class EnumTestCase(unittest.TestCase): def test_valid_enum(self): example_model = ExampleModel(root="model1") @@ -343,12 +333,14 @@ class HasEnumInList(HasTraits): @requires_traitsui -@unittest.skipIf(is_null, "GUI toolkit not available") -class TestGui(unittest.TestCase): - +class TestEnumCreateEditor(unittest.TestCase): def test_create_editor(self): - from traitsui.testing.api import UITester - - obj = EnumCollectionGUIExample() - with UITester().create_ui(obj): - pass + import traitsui.editor_factory + + obj = EnumListExample() + trait = obj.trait("value") + editor_factory = trait.trait_type.create_editor() + self.assertIsInstance( + editor_factory, + traitsui.editor_factory.EditorFactory + )