Skip to content

Commit b37367c

Browse files
committed
The assert failure message, redone. Again.
- Based on @boegel's phrasing request, from lessons related to the lack of tests not being fully isolated from the environment. See the following issue for more information: #3231 - Also added back the stringification of the types, including the tuple, by wrapping the output in str().
1 parent 6e7fb5f commit b37367c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/framework/easyconfigparser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ def test_easyconfig_constants(self):
184184
for constant_name in constants:
185185
self.assertTrue(isinstance(constant_name, string_type), "Constant name %s is a string" % constant_name)
186186
val = constants[constant_name]
187-
self.assertTrue(isinstance(val, (string_type, dict, tuple)),
188-
"The constant %s has an acceptable type" % constant_name)
187+
fail_msg = "The constant %s should have an acceptable type, found %s (%s)"
188+
% (constant_name, type(val), str(val))
189+
self.assertTrue(isinstance(val, (string_type, dict, tuple)), fail_msg)
189190

190191
# check a couple of randomly picked constant values
191192
self.assertEqual(constants['SOURCE_TAR_GZ'], '%(name)s-%(version)s.tar.gz')

0 commit comments

Comments
 (0)