Merge lp:~frankban/launchpad/bug-993510 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Brad Crittenden on 2012-05-28 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 15318 |
| Proposed branch: | lp:~frankban/launchpad/bug-993510 |
| Merge into: | lp:launchpad |
| Diff against target: |
51 lines (+18/-1) 2 files modified
lib/lp/testing/__init__.py (+1/-1) lib/lp/testing/tests/test_testcase.py (+17/-0) |
| To merge this branch: | bzr merge lp:~frankban/launchpad/bug-993510 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Benji York (community) | code | 2012-05-28 | Approve on 2012-05-28 |
|
Review via email:
|
|||
Description of the Change
= Summary =
Log handlers are removed before each test because tests should not depend on global logging config.
== Changes ==
Iterate over a copy of the handler list, so that the original list is not affected by the .remove calls and all handlers are correctly removed.
NO QA
== Lint ==
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
== Tests ==
$ bin/test -vvc --load-list ../s6
Running tests at level 1
Running lp.testing.
Set up lp.testing.
Set up lp.testing.
Set up lp.testing.
Set up lp.testing.
Set up lp.testing.
Set up lp.testing.
Set up lp.testing.
Set up lp.testing.
Set up lp.testing.
Running:
lp.archivepubl
lp.services.
Ran 2 tests with 0 failures and 0 errors in 2.726 seconds.
Tearing down left over layers:
Tear down lp.testing.
Tear down lp.testing.
Tear down lp.testing.
Tear down lp.testing.
Tear down lp.testing.
Tear down lp.testing.
Tear down lp.testing.
Tear down lp.testing.
Tear down lp.testing.
| Francesco Banconi (frankban) wrote : | # |
Thanks Benji, added a test as you suggested.
$ bin/test -cvvt lp.testing.
Running tests at level 1
Running zope.testing.
Set up zope.testing.
Running:
lp.testing.
Ran 1 tests with 0 failures and 0 errors in 0.001 seconds.
Tearing down left over layers:
Tear down zope.testing.
| Benji York (benji) wrote : | # |
The test looks good. It is sort of funny (in a good way) how the test machinery is part of the test itself.

Looks good. I see why this would be a problem.
I wonder if we should have a test for this behaviour.