[MERGE] Slight test suite refactorings

Martin Pool mbp at sourcefrog.net
Tue Apr 1 07:35:45 BST 2008


On Tue, Apr 1, 2008 at 4:25 PM, Vincent Ladeuil <v.ladeuil+lp at free.fr> wrote:
> These are needed for the upcoming FilteredByModuleTestLoader (see
>  loom https://code.launchpad.net/~v-ladeuil/bzr/faster-selftest
>  for full context).

Hm, no bb response yet.

+        self.assertEqual(set(_test_ids(self.suite)),
+                         set(_test_ids(randomized_suite)))

In passing, I would probably write this as comparing sorted(x),
sorted(y).  I realize it's not your original code.

@@ -2933,8 +2926,13 @@
     >>> tests[1].param
     2
     """
-    loader = TestLoader()
-    suite = TestSuite()
+    # XXX: Isn't load_tests() a better way to provide the same functionality
+    # without forcing a predefined TestScenarioApplier ? --vila 080215
+    if loader is None:
+        loader = TestUtil.TestLoader()
+
+    suite = loader.suiteClass()
+

I agree with the sentiment but I don't understand this comment in this location.

bb: tweak

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list