mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-04 00:48:24 +08:00
BUG: Fix hardcoded type repr in test.
Types repr differently in py2 vs py3.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user