We discussed the accidentally-included message argument on line 76 of
the diff in IRC.
I would add failure messages to the asserts inside your custom assert
methods: assertOldLinkMissing, assertOldLinkPresent,
assertNewLinksMissing, assertNewLinksPresent.
Skipping DistroView.setUp on line 345 of the diff and calling
BrowserTestCase.setUp instead confused me. If I replace it with a call
to DistroView.setUp the tests still pass.
Also, you didn't start it, but the manual test suite construction in
test_suite is kinda ugly and brittle (a test could easily be dropped
from the list and not noticed). Here's a change that uses the standard
unittest test loader but ignores test cases from the base class that we
want to avoid (also available at http://pastebin.ubuntu.com/593155/).
We discussed the accidentally- included message argument on line 76 of
the diff in IRC.
I would add failure messages to the asserts inside your custom assert ssing, assertOldLinkPr esent, issing, assertNewLinksP resent.
methods: assertOldLinkMi
assertNewLinksM
Skipping DistroView.setUp on line 345 of the diff and calling .setUp instead confused me. If I replace it with a call
BrowserTestCase
to DistroView.setUp the tests still pass.
Also, you didn't start it, but the manual test suite construction in pastebin. ubuntu. com/593155/).
test_suite is kinda ugly and brittle (a test could easily be dropped
from the list and not noticed). Here's a change that uses the standard
unittest test loader but ignores test cases from the base class that we
want to avoid (also available at http://
=== modified file 'lib/lp/ registry/ browser/ tests/test_ subscription_ links.py' registry/ browser/ tests/test_ subscription_ links.py 2011-04-12 14:49:43 +0000 registry/ browser/ tests/test_ subscription_ links.py 2011-04-12 14:49:49 +0000
self. assertNewLinksM issing( )
--- lib/lp/
+++ lib/lp/
@@ -855,40 +855,19 @@
+class CustomTestLoade r(unittest. TestLoader) : s(self, testCaseClass): tLoader, self).getTestCa seNames( scriptionTarget ` TestSuite.""" TestSuite( ) unittest. makeSuite( ProductView) ) unittest. makeSuite( ProductBugs) ) unittest. makeSuite( ProductSeriesVi ew)) unittest. makeSuite( ProductSeriesBu gs)) unittest. makeSuite( ProjectGroupVie w)) unittest. makeSuite( ProjectGroupBug s)) unittest. makeSuite( DistributionSou rcePackageView) ) unittest. makeSuite( DistributionSou rcePackageBugs) ) unittest. makeSuite( DistroView) ) unittest. makeSuite( DistroBugs) ) unittest. makeSuite( DistroMilestone View)) unittest. makeSuite( ProductMileston eView)) unittest. makeSuite( ProductSeriesMi lestoneView) ) unittest. makeSuite( ProductDoesNotU seLPView) ) unittest. makeSuite( ProductDoesNotU seLPBugs) ) unittest. makeSuite( ProductSeriesDo esNotUseLPView) ) unittest. makeSuite( ProductSeriesDo esNotUseLPBugs) ) unittest. makeSuite( ProjectGroupDoe sNotUseLPView) ) unittest. makeSuite( ProjectGroupDoe sNotUseLPBugs) ) unittest. makeSuite( rcePackageDoesN otUseLPView) ) unittest. makeSuite( rcePackageDoesN otUseLPBugs) ) unittest. makeSuite( DistroDoesNotUs eLPView) ) unittest. makeSuite( DistroDoesNotUs eLPBugs) ) unittest. makeSuite( DoesNotUseLPVie w)) unittest. makeSuite( ProductMileston eDoesNotUseLPVi ew)) r().loadTestsFr omName( __name_ _)
+ """A test loader that avoids running tests from a base class."""
+
+ def getTestCaseName
+ # If we're asked about which tests to run for _TestStructSubs, reply
+ # with an empty list.
+ if testCaseClass is _TestStructSubs:
+ return []
+ else:
+ return super(CustomTes
+ testCaseClass)
+
+
def test_suite():
"""Return the `IStructuralSub
-
- # Manually construct the test suite to avoid having tests from the base
- # class _TestStructSubs run.
- suite = unittest.
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
-
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- suite.addTest(
- DistributionSou
- suite.addTest(
- DistributionSou
- suite.addTest(
- suite.addTest(
- suite.addTest(
- DistroMilestone
- suite.addTest(
-
- return suite
+ return CustomTestLoade