test_assertion: harden/improve test_{text_diff,unicode} (#6806)
This commit is contained in:
parent
ac3a42bafd
commit
6a7df7f031
|
@ -324,9 +324,11 @@ class TestAssert_reprcompare:
|
||||||
assert len(summary) < 65
|
assert len(summary) < 65
|
||||||
|
|
||||||
def test_text_diff(self):
|
def test_text_diff(self):
|
||||||
diff = callequal("spam", "eggs")[1:]
|
assert callequal("spam", "eggs") == [
|
||||||
assert "- eggs" in diff
|
"'spam' == 'eggs'",
|
||||||
assert "+ spam" in diff
|
"- eggs",
|
||||||
|
"+ spam",
|
||||||
|
]
|
||||||
|
|
||||||
def test_text_skipping(self):
|
def test_text_skipping(self):
|
||||||
lines = callequal("a" * 50 + "spam", "a" * 50 + "eggs")
|
lines = callequal("a" * 50 + "spam", "a" * 50 + "eggs")
|
||||||
|
@ -706,12 +708,11 @@ class TestAssert_reprcompare:
|
||||||
assert "raised in repr()" not in expl
|
assert "raised in repr()" not in expl
|
||||||
|
|
||||||
def test_unicode(self):
|
def test_unicode(self):
|
||||||
left = "£€"
|
assert callequal("£€", "£") == [
|
||||||
right = "£"
|
"'£€' == '£'",
|
||||||
expl = callequal(left, right)
|
"- £",
|
||||||
assert expl[0] == "'£€' == '£'"
|
"+ £€",
|
||||||
assert expl[1] == "- £"
|
]
|
||||||
assert expl[2] == "+ £€"
|
|
||||||
|
|
||||||
def test_nonascii_text(self):
|
def test_nonascii_text(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue