BUG: Fix hardcoded type repr in test.

Types repr differently in py2 vs py3.
This commit is contained in:
Scott Sanderson
2015-12-09 15:29:57 -05:00
parent f8ab8a5159
commit 64ce6d26aa
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -65,6 +65,6 @@ class AdjustmentTestCase(TestCase):
exc = e.exception
expected_msg = (
"Don't know how to make overwrite adjustments for values of type "
"<class 'tests.pipeline.test_adjustment.SomeClass'>."
"%r." % SomeClass
)
self.assertEqual(str(exc), expected_msg)
+3 -3
View File
@@ -51,11 +51,11 @@ cpdef choose_adjustment_type(int adjustment_kind, object value):
if adjustment_kind in (ADD, MULTIPLY):
if not _is_float(value):
raise TypeError(
"Can't construct %s Adjustment with value of type %s.\n"
"Can't construct %s Adjustment with value of type %r.\n"
"ADD and MULTIPLY adjustments are only supported for "
"floating point data." % (
ADJUSTMENT_KIND_NAMES[adjustment_kind],
type(value).__name__,
type(value),
)
)
return _float_adjustment_types[adjustment_kind]
@@ -68,7 +68,7 @@ cpdef choose_adjustment_type(int adjustment_kind, object value):
else:
raise TypeError(
"Don't know how to make overwrite "
"adjustments for values of type %s." % type(value),
"adjustments for values of type %r." % type(value),
)
else:
raise ValueError("Unknown adjustment type %d." % adjustment_kind)