Skip to content

Commit

Permalink
py3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jan 20, 2019
1 parent 18a6306 commit b0cc4a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/python/pants_test/util/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def test_instance_construction_errors(self):
SomeTypedDatatype()
expected_msg = """\
error: in constructor of type SomeTypedDatatype: type check error:
missing arguments: [u'val']"""
missing arguments: [{}'val']""".format('u' if PY2 else '')
self.assertEqual(str(cm.exception), expected_msg)

# unrecognized fields
Expand All @@ -568,7 +568,7 @@ def test_instance_construction_errors(self):
error: in constructor of type SomeTypedDatatype: type check error:
too many positional arguments: 2 arguments for 1 fields!
args: (3, 4)
fields: [u'val']"""
fields: [{}'val']""".format('u' if PY2 else '')
self.assertEqual(str(cm.exception), expected_msg)

with self.assertRaises(TypedDatatypeInstanceConstructionError) as cm:
Expand Down Expand Up @@ -662,7 +662,7 @@ def compare_str(unicode_type_name, include_unicode=False):
WithCollectionTypeConstraint([3, "asdf"])
expected_msg = """\
error: in constructor of type WithCollectionTypeConstraint: type check error:
field 'dependencies' was invalid: value [3, u'asdf'] (with type 'list') must satisfy this type constraint: TypedCollection(Exactly(int), wrapper_type=tuple)."""
field 'dependencies' was invalid: value [3, {}'asdf'] (with type 'list') must satisfy this type constraint: TypedCollection(Exactly(int), wrapper_type=tuple).""".format('u' if PY2 else '')
self.assertEqual(str(cm.exception), expected_msg)

def test_copy(self):
Expand Down

0 comments on commit b0cc4a0

Please sign in to comment.