-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testlib: change approach for --sit and log captures, take two
Commit 2cfcdac ("Create attachments and sit before cleanup handlers") accomplished its goal by monkeypatching some deep internals of unittest. Instead of trying to monkeypatch unittest, handle attachments and sit() from from tearDown(). It also gets called before cleanups, and we already have similar failure-checking code present there for us to use. Update from Martin Pitt: The first attempt was reverted in commit 94369d9 as it did not print tracebacks properly, which broke both `--sit` mode (not showing the error) and naughty matching (as they match on the traceback). To fix that, change the boolean checkSuccess() to getError() which returns traceback object if there was any error. tearDown() can use that to print the error before calling the cleanup handlers.
- Loading branch information
1 parent
a37625a
commit 669a54a
Showing
1 changed file
with
27 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters