def METHOD_NAME(self):
    class HasUnionWithList(HasTraits):
        foo = Union(List(Int), Str)
    has_union = HasUnionWithList()
    value = has_union.foo
    self.assertIsInstance(value, list)
    with self.assertRaises(TraitError):
        value.append("not an integer")