Rev 2701: Reduce the size of the selftest output header in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Aug 15 04:52:21 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2701
revision-id: pqm at pqm.ubuntu.com-20070815035159-9hn3rewqcmibgvwq
parent: pqm at pqm.ubuntu.com-20070815023951-yj66qy38vxjbdwrl
parent: mbp at sourcefrog.net-20070809052820-dok5dy9lcibtzrsp
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-08-15 04:51:59 +0100
message:
  Reduce the size of the selftest output header
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_selftest.py test_selftest.py-20060123024542-01c5f1bbcb596d78
    ------------------------------------------------------------
    revno: 2687.3.1
    merged: mbp at sourcefrog.net-20070809052820-dok5dy9lcibtzrsp
    parent: pqm at pqm.ubuntu.com-20070809000503-7gad4qd85xll5ucf
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: test-show-version
    timestamp: Thu 2007-08-09 15:28:20 +1000
    message:
      Revert selftest header to just two lines, but still show the bzrlib and python versions
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-08-09 15:19:06 +0000
+++ b/bzrlib/builtins.py	2007-08-15 03:51:59 +0000
@@ -2529,7 +2529,12 @@
         if cache_dir is not None:
             tree_creator.TreeCreator.CACHE_ROOT = osutils.abspath(cache_dir)
         if not list_only:
-            show_version(show_config=False, show_copyright=False)
+            print 'testing: %s' % (osutils.realpath(sys.argv[0]),)
+            print '   %s (%s python%s)' % (
+                    bzrlib.__path__[0],
+                    bzrlib.version_string,
+                    '.'.join(map(str, sys.version_info)),
+                    )
         print
         if testspecs_list is not None:
             pattern = '|'.join(testspecs_list)

=== modified file 'bzrlib/tests/blackbox/test_selftest.py'
--- a/bzrlib/tests/blackbox/test_selftest.py	2007-08-15 01:16:12 +0000
+++ b/bzrlib/tests/blackbox/test_selftest.py	2007-08-15 03:51:59 +0000
@@ -486,13 +486,12 @@
     @staticmethod
     def _parse_test_list(lines, newlines_in_header=1):
         "Parse a list of lines into a tuple of 3 lists (header,body,footer)."
-
         in_header = True
         in_footer = False
         header = []
         body = []
         footer = []
-        header_newlines_found = 0 
+        header_newlines_found = 0
         for line in lines:
             if in_header:
                 if line == '':
@@ -510,7 +509,7 @@
                 footer.append(line)
         # If the last body line is blank, drop it off the list
         if len(body) > 0 and body[-1] == '':
-            body.pop()                
+            body.pop()
         return (header,body,footer)
 
     def test_list_only(self):
@@ -550,6 +549,11 @@
                                           'selftest', '--randomize', 'now'])
         (header_rand,tests_rand,dummy) = self._parse_test_list(
             out_rand.splitlines(), 2)
+        # XXX: The following line asserts that the randomized order is not the
+        # same as the default order.  It is just possible that they'll get
+        # randomized into the same order and this will falsely fail, but
+        # that's very unlikely in practice because there are thousands of
+        # tests.
         self.assertNotEqual(tests_all, tests_rand)
         self.assertEqual(sorted(tests_all), sorted(tests_rand))
         # Check that the seed can be reused to get the exact same order




More information about the bazaar-commits mailing list