diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2014-02-09 07:20:03 +0100 |
---|---|---|
committer | Alexis Hildebrandt <afh@surryhill.net> | 2014-02-09 07:20:03 +0100 |
commit | 960ebc2a572e3ff90d2b95c54f618430df5db351 (patch) | |
tree | 1e2166c93b0853ccd65e8738583a1fdca29c4672 /test/DocTests.py | |
parent | a1cc8ca15ae1761fbcb4c6ec9f8af82e8ab411ab (diff) | |
download | fork-ledger-960ebc2a572e3ff90d2b95c54f618430df5db351.tar.gz fork-ledger-960ebc2a572e3ff90d2b95c54f618430df5db351.tar.bz2 fork-ledger-960ebc2a572e3ff90d2b95c54f618430df5db351.zip |
Print summary list of failed doc tests if any
Diffstat (limited to 'test/DocTests.py')
-rwxr-xr-x | test/DocTests.py | 9 |
1 files changed, 6 insertions, 3 deletions
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) |