ENH: Include choices in no-output-found errormsg.

This commit is contained in:
Scott Sanderson
2016-05-17 17:51:24 -04:00
parent 2d596dc490
commit 4a513360b6
2 changed files with 11 additions and 6 deletions
+6 -4
View File
@@ -457,14 +457,16 @@ class ObjectIdentityTestCase(TestCase):
errmsg, "'SomeFactor' object has no attribute 'not_an_attr'",
)
mo = MultipleOutputs()
with self.assertRaises(AttributeError) as e:
MultipleOutputs().not_an_attr
mo.not_an_attr
errmsg = str(e.exception)
self.assertEqual(
errmsg,
"Instance of MultipleOutputs has no output called 'not_an_attr'.",
expected = (
"Instance of MultipleOutputs has no output named 'not_an_attr'."
" Possible choices are: ('alpha', 'beta')."
)
self.assertEqual(errmsg, expected)
with self.assertRaises(ValueError) as e:
alpha, beta = GenericCustomFactor()