have tests pass in python37; move to separate file

This commit is contained in:
Aly Sivji 2018-11-12 11:24:15 -06:00
parent a663f60b05
commit 4e99c80425
2 changed files with 14 additions and 14 deletions

View File

@ -343,16 +343,16 @@ def _compare_eq_cls(left, right, verbose, type_fns):
explanation = [] explanation = []
if same and verbose < 2: if same and verbose < 2:
explanation += [u("Omitting %s identical items, use -vv to show") % len(same)] explanation.append(u"Omitting %s identical items, use -vv to show" % len(same))
elif same: elif same:
explanation += [u("Common attributes:")] explanation += [u"Common attributes:"]
explanation += pprint.pformat(same).splitlines() explanation += pprint.pformat(same).splitlines()
if diff: if diff:
class_name = left.__class__.__name__ class_name = left.__class__.__name__
explanation += [("Differing attributes:")] explanation += [u"Differing attributes:"]
for k in diff: for k in diff:
explanation += [ explanation += [
u("%s(%s=%r) != %s(%s=%r)") (u"%s(%s=%r) != %s(%s=%r)")
% (class_name, k, getattr(left, k), class_name, k, getattr(right, k)) % (class_name, k, getattr(left, k), class_name, k, getattr(right, k))
] ]
return explanation return explanation

View File

@ -556,8 +556,8 @@ class TestAssert_reprcompare_dataclass(object):
@dataclass @dataclass
class SimpleDataObject(object): class SimpleDataObject(object):
field_a = field() field_a: int = field()
field_b = field() field_b: int = field()
left = SimpleDataObject(1, "b") left = SimpleDataObject(1, "b")
right = SimpleDataObject(1, "c") right = SimpleDataObject(1, "c")
@ -574,8 +574,8 @@ class TestAssert_reprcompare_dataclass(object):
@dataclass @dataclass
class SimpleDataObject(object): class SimpleDataObject(object):
field_a = field() field_a: int = field()
field_b = field() field_b: int = field()
left = SimpleDataObject(1, "b") left = SimpleDataObject(1, "b")
right = SimpleDataObject(1, "c") right = SimpleDataObject(1, "c")
@ -591,8 +591,8 @@ class TestAssert_reprcompare_dataclass(object):
@dataclass @dataclass
class SimpleDataObject(object): class SimpleDataObject(object):
field_a = field() field_a: int = field()
field_b = field(compare=False) field_b: int = field(compare=False)
left = SimpleDataObject(1, "b") left = SimpleDataObject(1, "b")
right = SimpleDataObject(1, "b") right = SimpleDataObject(1, "b")
@ -610,13 +610,13 @@ class TestAssert_reprcompare_dataclass(object):
@dataclass @dataclass
class SimpleDataObjectOne(object): class SimpleDataObjectOne(object):
field_a = field() field_a: int = field()
field_b = field() field_b: int = field()
@dataclass @dataclass
class SimpleDataObjectTwo(object): class SimpleDataObjectTwo(object):
field_a = field() field_a: int = field()
field_b = field() field_b: int = field()
left = SimpleDataObjectOne(1, "b") left = SimpleDataObjectOne(1, "b")
right = SimpleDataObjectTwo(1, "c") right = SimpleDataObjectTwo(1, "c")