Skip to content

Commit ef3e50c

Browse files
committed
Fix testdoc with timeouts
Also add a test with timeout to testdoc atests
1 parent db735a6 commit ef3e50c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

atest/robot/testdoc/testdoc.robot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Resource atest_resource.robot
33

44
*** Variables ***
5-
${INPUT 1} ${DATADIR}${/}misc${/}pass_and_fail.robot
5+
${INPUT 1} ${DATADIR}${/}misc${/}normal.robot
66
${INPUT 2} ${DATADIR}${/}misc${/}suites
77
${INPUT 3} ${DATADIR}${/}testdoc
88
${OUTFILE} %{TEMPDIR}/testdoc-output.html
@@ -12,7 +12,7 @@ ${ARGFILE 2} %{TEMPDIR}/testdoc_argfile_2.txt
1212
*** Test Cases ***
1313
One input
1414
Run TestDoc ${INPUT 1}
15-
Testdoc Should Contain "name":"Pass And Fail" "title":"Pass And Fail" "numberOfTests":2
15+
Testdoc Should Contain "name":"First One" "title":"Normal" "numberOfTests":2
1616
Outfile Should Have Correct Line Separators
1717
Output Should Contain Outfile
1818

@@ -25,7 +25,7 @@ Variables and imports are not processes
2525
Many inputs
2626
Run TestDoc --exclude t1 --title Nön-ÄSCII
2727
... ${INPUT 1} ${INPUT2} ${INPUT 3}
28-
Testdoc Should Contain "name":"Pass And Fail & Suites & Testdoc" "title":"Nön-ÄSCII" "numberOfTests":8
28+
Testdoc Should Contain "name":"Normal & Suites & Testdoc" "title":"Nön-ÄSCII" "numberOfTests":7
2929
Testdoc Should Not Contain "name":"Suite4 First"
3030
Outfile Should Have Correct Line Separators
3131
Output Should Contain Outfile
@@ -37,7 +37,7 @@ Argument file
3737
... ${EMPTY}
3838
... \# I'm a comment and I'm OK! And so are empty rows around me too.
3939
... ${EMPTY}
40-
... --exclude pass
40+
... --exclude t2
4141
Create Argument File ${ARGFILE 2}
4242
... --title My title!
4343
... ${INPUT 1}

src/robot/testdoc.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,9 @@ def _get_timeout(self, timeout):
258258
if timeout is None:
259259
return ''
260260
try:
261-
tout = secs_to_timestr(timestr_to_secs(timeout.value))
261+
tout = secs_to_timestr(timestr_to_secs(timeout))
262262
except ValueError:
263-
tout = timeout.value
264-
if timeout.message:
265-
tout += ' :: ' + timeout.message
263+
tout = timeout
266264
return tout
267265

268266

utest/testdoc/test_jsonconverter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_timeout(self):
120120
timeout='1 minute 42 seconds')
121121
test_convert(self.suite['suites'][-2]['tests'][1],
122122
name='Test Timeout With Message',
123-
timeout='1 day 2 hours :: The message')
123+
timeout='1 day 2 hours')
124124
test_convert(self.suite['suites'][-2]['tests'][2],
125125
name='Test Timeout With Variable',
126126
timeout='${100}')

0 commit comments

Comments
 (0)