Launchpad does not have a sensible unittest framework

Bug #85465 reported by Andrew Bennetts
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Unassigned

Bug Description

WebserverHelper (in lib/canonical/launchpad/scripts/tests/webserver_helper.py) inherits from importd.tests.helpers.SandboxHelper. There are a few problems with this.

SandboxHelper always uses the same sandbox directory: ",,job_test". Tests ought to be independent from each other, even if a previous test didn't run its tearDown because it failed. A much better approach would be make and use a new temporary directory each time (and with a directory name that is more helpful than ",,job_test").

Also, SandboxHelper mucks with os.environ['HOME'], which is important for some tests, but irrelevant for most. It certainly is irrelevant to WebserverHelper.

Finally, canonical.launchpad.scripts.tests depending on importd.tests not a good dependency, I think. We ought to have infrastructure like this in a sensible place, rather than in a random module (or just as bad re-done ad hoc, like the tempdir thing is done in various places throughout the test suite).

Revision history for this message
David Allouche (ddaa) wrote :

Yes.

I would be glad to spend some time working on collecting the various reusable test helpers I have written over time into a single place.

Just get agreement on what should be this place, and then we can start discuss the specifics of what to put there and what to fix.

Changed in launchpad:
importance: Undecided → Low
status: Unconfirmed → Confirmed
Curtis Hovey (sinzui)
Changed in launchpad-foundations:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.