From 960ebc2a572e3ff90d2b95c54f618430df5db351 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 9 Feb 2014 07:20:03 +0100 Subject: Print summary list of failed doc tests if any --- test/DocTests.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/DocTests.py') diff --git a/test/DocTests.py b/test/DocTests.py index eb1a0205..736be6c7 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -83,7 +83,7 @@ class DocTests: } def test_examples(self): - failed = 0 + failed = set() for test_id in self.examples: example = self.examples[test_id] try: @@ -143,14 +143,17 @@ class DocTests: sys.stdout.write('.' if valid else 'E') if not valid: - failed += 1 if self.debug: + failed.add(test_id) print ' '.join(command) for line in unified_diff(output.split('\n'), verify.split('\n'), fromfile='generated', tofile='expected'): print(line) print print - return failed + if len(failed) > 0: + print "\nThe following examples failed:" + print " ", "\n ".join(failed) + return len(failed) def main(self): self.file = open(self.sourcepath) -- cgit v1.2.3