Merge lp:~jml/launchpad/warnings-for-unproxied into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11263 |
Proposed branch: | lp:~jml/launchpad/warnings-for-unproxied |
Merge into: | lp:launchpad |
Diff against target: |
110 lines (+35/-14) 3 files modified
buildout-templates/bin/test.in (+5/-4) lib/lp/scripts/utilities/warninghandler.py (+4/-2) lib/lp/testing/factory.py (+26/-8) |
To merge this branch: | bzr merge lp:~jml/launchpad/warnings-for-unproxied |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+30891@code.launchpad.net |
Commit message
Use warnings instead of printing to stderr for unwrapped proxy methods.
Description of the change
This branch changes the warnings printed directly by Abel's wrapper to use Python's warning system directly.
IMPORTANT: This branch also changes our long-standing policy of raising errors in the test suite whenever there is a non-silenced warning. I can think of no good reason for this policy.
Otherwise, the changes are quite simple:
- add two new warning classes
- use these warnings instead of printing to stderr
- stacklevel=1 for the factory wrapper guarantees only one warning per bad factory method
- stacklevel=2 for the "and shout at engineer" function guarantees only one warning per caller
- change the warning summarizer to only print one copy of each error
I've added a XXX because the criteria for remove_