Skip to content

Commit 5c1a8e8

Browse files
committed
feat: improve timeout errors
1 parent d57261b commit 5c1a8e8

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

byexample/modules/progress.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,21 @@ def timedout(self, example, exception):
125125
input = short_string(exception.input)
126126

127127
msg += self._bullet('cyan', '-') + ' '
128-
msg += ("This happen before typing '%s'.\n" % input) + \
129-
"Perhaps the text before did not match what you expected?\n" + \
130-
(exception.prefix) + '\n'
128+
msg += ("This happen before typing >>%s<<.\n" % input) + \
129+
"Perhaps the text before did not match what you expected? You were expecting:\n" + \
130+
">>" + (exception.prefix) + "<<" + '\n'
131131

132132
exception_output = exception.output.rstrip()
133133
if exception_output:
134134
msg += self._bullet('cyan', '-') + ' '
135-
msg += 'This is the last output obtained:\n%s\n' % str(
135+
msg += 'This is the last output obtained:\n>>%s<<\n' % str(
136136
exception_output
137137
)
138138

139139
exception_raw_output = exception.raw_output.rstrip()
140140
if self.verbosity >= 4 and exception_raw_output:
141141
msg += self._bullet('yellow', '-') + ' '
142-
msg += 'This is the last raw output obtained:\n%s\n' % str(
142+
msg += 'This is the last raw output obtained:\n>>%s<<\n' % str(
143143
exception_raw_output
144144
)
145145

docs/basic/input.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ $ byexample -l python test/ds/maximum-ctx-input.md
176176
- This could be because the example just ran too slow (try add more time
177177
with +timeout=<n>) or the example is "syntactically incorrect" and
178178
the interpreter hang (may be you forgot a parenthesis or something like that?).
179-
- This happen before typing 'foo'.
180-
Perhaps the text before did not match what you expected?
181-
typo! text:
179+
- This happen before typing >>foo<<.
180+
Perhaps the text before did not match what you expected? You were expecting:
181+
>>typo! text: <<
182182
- This is the last output obtained:
183-
Some large text:
183+
>>Some large text:<<
184184
<...>
185185
[ABORT] Pass: 0 Fail: 1 Skip: 0
186186
```

0 commit comments

Comments
 (0)