diff --git a/tests/pipeline/test_adjustment.py b/tests/pipeline/test_adjustment.py index 73fa2546..d5c99c0e 100644 --- a/tests/pipeline/test_adjustment.py +++ b/tests/pipeline/test_adjustment.py @@ -65,6 +65,6 @@ class AdjustmentTestCase(TestCase): exc = e.exception expected_msg = ( "Don't know how to make overwrite adjustments for values of type " - "." + "%r." % SomeClass ) self.assertEqual(str(exc), expected_msg) diff --git a/zipline/lib/adjustment.pyx b/zipline/lib/adjustment.pyx index 8bdeee00..9d1a7c2f 100644 --- a/zipline/lib/adjustment.pyx +++ b/zipline/lib/adjustment.pyx @@ -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)