Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
uwdkn
mjtest
Commits
7b4adf13
Commit
7b4adf13
authored
Dec 17, 2018
by
Andreas Fried
Browse files
Dump source files by lines, not by characters, when a test fails.
parent
a5729b73
Changes
1
Hide whitespace changes
Inline
Side-by-side
mjtest/test/tests.py
View file @
7b4adf13
...
...
@@ -349,7 +349,7 @@ class ExtensibleTestResult(TestResult):
def
add_file
(
self
,
title
:
str
,
file_name
:
str
,
with_line_numbers
:
bool
=
True
):
with
open
(
file_name
,
"r"
,
errors
=
"backslashreplace"
)
as
f
:
file_content
=
os
.
linesep
.
join
([
line
.
rstrip
()
for
line
in
f
.
read
()])
file_content
=
os
.
linesep
.
join
([
line
.
rstrip
()
for
line
in
f
.
read
lines
()])
self
.
add_long_text
(
title
,
file_content
,
with_line_numbers
)
def
succeeded
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment