Updated test_dimension_comparison_types_unequal to work on Python 3
"""
Test cases for Dimension and Dimensioned object comparison.
"""
-
+import sys
from holoviews.core import Dimension, Dimensioned
from holoviews.element.comparison import ComparisonTestCase
+py3 = (sys.version_info.major == 3)
class DimensionsComparisonTestCase(ComparisonTestCase):
@@ -81,6 +82,9 @@ class DimensionsComparisonTestCase(ComparisonTestCase):
try:
self.assertEqual(self.dimension9, self.dimension10)
except AssertionError as e:
+ if py3:
+ self.assertEqual(str(e), "Dimension parameter 'type' mismatched: <class 'int'> != <class 'float'>")
+ else:
self.assertEqual(str(e), "Dimension parameter 'type' mismatched: <type 'int'> != <type 'float'>")
