File tree 4 files changed +24
-2
lines changed
4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ Mark Abramowitz
41
41
Martijn Faassen
42
42
Nicolas Delaby
43
43
Piotr Banaszkiewicz
44
+ Punyashloka Biswal
44
45
Ralf Schmitt
45
46
Ronny Pfannschmidt
46
47
Ross Lawley
Original file line number Diff line number Diff line change 1
1
2.7.2 (compared to 2.7.1)
2
2
-----------------------------
3
3
4
+ - fix issue713: JUnit XML reports for doctest failures.
5
+ Thanks Punyashloka Biswal.
6
+
4
7
- fix issue735: assertion failures on debug versions of Python 3.4+
5
8
Thanks Benjamin Peterson.
6
9
Original file line number Diff line number Diff line change @@ -123,10 +123,12 @@ def append_failure(self, report):
123
123
Junit .skipped (message = "xfail-marked test passes unexpectedly" ))
124
124
self .skipped += 1
125
125
else :
126
- if isinstance (report .longrepr , (unicode , str )):
126
+ if hasattr (report .longrepr , "reprcrash" ):
127
+ message = report .longrepr .reprcrash .message
128
+ elif isinstance (report .longrepr , (unicode , str )):
127
129
message = report .longrepr
128
130
else :
129
- message = report .longrepr . reprcrash . message
131
+ message = str ( report .longrepr )
130
132
message = bin_xml_escape (message )
131
133
fail = Junit .failure (message = message )
132
134
fail .append (bin_xml_escape (report .longrepr ))
Original file line number Diff line number Diff line change @@ -354,3 +354,19 @@ def add_one(x):
354
354
reprec = testdir .inline_run (p , "--doctest-modules" ,
355
355
"--doctest-ignore-import-errors" )
356
356
reprec .assertoutcome (skipped = 1 , failed = 1 , passed = 0 )
357
+
358
+ def test_junit_report_for_doctest (self , testdir ):
359
+ """
360
+ #713: Fix --junit-xml option when used with --doctest-modules.
361
+ """
362
+ p = testdir .makepyfile ("""
363
+ def foo():
364
+ '''
365
+ >>> 1 + 1
366
+ 3
367
+ '''
368
+ pass
369
+ """ )
370
+ reprec = testdir .inline_run (p , "--doctest-modules" ,
371
+ "--junit-xml=junit.xml" )
372
+ reprec .assertoutcome (failed = 1 )
You can’t perform that action at this time.
0 commit comments