e3279b4253f1ab07ee15afae31eb87102f831d5b,tests/python/pants_test/util/test_objects.py,TypedDatatypeTest,test_instance_construction_by_repr,#TypedDatatypeTest#,369
Before Change
def compare_string_rep(string_type):
expected_message = "MixedTyping(value=3, name<={0}>=asdf)".format(string_type)
self.assertEqual(str(mixed_type_obj), expected_message)
if "newstr" in str(mixed_type_obj): // Python2
compare_string_rep("newstr")
else: // Python3
compare_string_rep("str")
subclass_constraint_obj = WithSubclassTypeConstraint(SomeDatatypeClass())
self.assertEqual("asdf", subclass_constraint_obj.some_value.something())
self.assertEqual(repr(subclass_constraint_obj),
"WithSubclassTypeConstraint(some_value=SomeDatatypeClass())")
After Change
def compare_str(unicode_type_name):
expected_message = "MixedTyping(value=3, name<={}>=asdf)".format(unicode_type_name)
self.assertEqual(str(mixed_type_obj), expected_message)
if PY2:
compare_str("unicode")
compare_repr(include_unicode=True)
else:
compare_str("str")
compare_repr()
subclass_constraint_obj = WithSubclassTypeConstraint(SomeDatatypeClass())
self.assertEqual("asdf", subclass_constraint_obj.some_value.something())
self.assertEqual(repr(subclass_constraint_obj),
"WithSubclassTypeConstraint(some_value=SomeDatatypeClass())")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: pantsbuild/pants
Commit Name: e3279b4253f1ab07ee15afae31eb87102f831d5b
Time: 2018-07-15
Author: ericarellano@me.com
File Name: tests/python/pants_test/util/test_objects.py
Class Name: TypedDatatypeTest
Method Name: test_instance_construction_by_repr
Project Name: pantsbuild/pants
Commit Name: e3279b4253f1ab07ee15afae31eb87102f831d5b
Time: 2018-07-15
Author: ericarellano@me.com
File Name: tests/python/pants_test/util/test_objects.py
Class Name: TypedDatatypeTest
Method Name: test_mixin_type_construction
Project Name: pantsbuild/pants
Commit Name: e3279b4253f1ab07ee15afae31eb87102f831d5b
Time: 2018-07-15
Author: ericarellano@me.com
File Name: tests/python/pants_test/util/test_objects.py
Class Name: TypedDatatypeTest
Method Name: test_class_construction_errors