change separator to hyphen
This commit is contained in:
parent
37ecca3ba9
commit
159704421e
|
@ -210,11 +210,8 @@ def _get_line_with_reprcrash_message(config, rep, termwidth):
|
|||
pos = _get_pos(config, rep)
|
||||
|
||||
line = "%s %s" % (verbose_word, pos)
|
||||
|
||||
len_line = len(line)
|
||||
ellipsis = "..."
|
||||
len_ellipsis = len(ellipsis)
|
||||
|
||||
ellipsis, len_ellipsis = "...", 3
|
||||
if len_line > termwidth - len_ellipsis:
|
||||
# No space for an additional message.
|
||||
return line
|
||||
|
@ -230,12 +227,11 @@ def _get_line_with_reprcrash_message(config, rep, termwidth):
|
|||
msg = msg[:i]
|
||||
len_msg = len(msg)
|
||||
|
||||
sep = ": "
|
||||
len_sep = len(sep)
|
||||
max_len = termwidth - len_line - len_sep
|
||||
if max_len >= len_ellipsis:
|
||||
if len_msg > max_len:
|
||||
msg = msg[: (max_len - len_ellipsis)] + ellipsis
|
||||
sep, len_sep = " - ", 3
|
||||
max_len_msg = termwidth - len_line - len_sep
|
||||
if max_len_msg >= len_ellipsis:
|
||||
if len_msg > max_len_msg:
|
||||
msg = msg[: (max_len_msg - len_ellipsis)] + ellipsis
|
||||
line += sep + msg
|
||||
return line
|
||||
|
||||
|
|
|
@ -1208,7 +1208,7 @@ def test_summary_list_after_errors(testdir):
|
|||
[
|
||||
"=* FAILURES *=",
|
||||
"*= short test summary info =*",
|
||||
"FAILED test_summary_list_after_errors.py::test_fail: assert 0",
|
||||
"FAILED test_summary_list_after_errors.py::test_fail - assert 0",
|
||||
]
|
||||
)
|
||||
|
||||
|
@ -1240,18 +1240,18 @@ def test_line_with_reprcrash(monkeypatch):
|
|||
class reprcrash:
|
||||
message = "msg"
|
||||
|
||||
assert f(config, rep, 80) == "FAILED some::nodeid: msg"
|
||||
assert f(config, rep, 80) == "FAILED some::nodeid - msg"
|
||||
assert f(config, rep, 3) == "FAILED some::nodeid"
|
||||
|
||||
assert f(config, rep, 23) == "FAILED some::nodeid"
|
||||
assert f(config, rep, 24) == "FAILED some::nodeid: msg"
|
||||
assert f(config, rep, 24) == "FAILED some::nodeid"
|
||||
assert f(config, rep, 25) == "FAILED some::nodeid - msg"
|
||||
|
||||
rep.longrepr.reprcrash.message = "some longer message"
|
||||
assert f(config, rep, 23) == "FAILED some::nodeid"
|
||||
assert f(config, rep, 24) == "FAILED some::nodeid: ..."
|
||||
assert f(config, rep, 25) == "FAILED some::nodeid: s..."
|
||||
assert f(config, rep, 24) == "FAILED some::nodeid"
|
||||
assert f(config, rep, 25) == "FAILED some::nodeid - ..."
|
||||
assert f(config, rep, 26) == "FAILED some::nodeid - s..."
|
||||
|
||||
rep.longrepr.reprcrash.message = "some\nmessage"
|
||||
assert f(config, rep, 24) == "FAILED some::nodeid: ..."
|
||||
assert f(config, rep, 25) == "FAILED some::nodeid: some"
|
||||
assert f(config, rep, 80) == "FAILED some::nodeid: some"
|
||||
assert f(config, rep, 25) == "FAILED some::nodeid - ..."
|
||||
assert f(config, rep, 26) == "FAILED some::nodeid - some"
|
||||
assert f(config, rep, 80) == "FAILED some::nodeid - some"
|
||||
|
|
|
@ -735,7 +735,7 @@ def test_fail_extra_reporting(testdir, monkeypatch):
|
|||
result.stdout.fnmatch_lines(
|
||||
[
|
||||
"*test summary*",
|
||||
"FAILED test_fail_extra_reporting.py::test_this: AssertionError: this_failedth...",
|
||||
"FAILED test_fail_extra_reporting.py::test_this - AssertionError: this_failedt...",
|
||||
]
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue