def test_incorrect_add(self): """Test that adding a non-BaseTrait will raise an exception.""" with self.assertRaisesRegex(Exception, 'only be added'): traits.BaseTrait() + 3
class Foo: bar = traits.BaseTrait()
class Foo: a = traits.BaseTrait()