~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2007-06-26 20:32:49 UTC
  • mto: (2581.1.1 cleanup-runbzr)
  • mto: This revision was merged to the branch mainline in revision 2588.
  • Revision ID: v.ladeuil+lp@free.fr-20070626203249-sqm4afiai5dxofum
Deprecate the varargs syntax and fix the tests.

* bzrlib/tests/__init__.py:
(TestCase.run_bzr): Activate the deprecation warning.
(TestCase.run_bzr_error): Add error_regexes to kwargs or run_bzr
get confused.

* bzrlib/tests/blackbox/test_selftest.py:
(TestRunBzr.test_args): Activate.

* bzrlib/tests/blackbox/test_inventory.py:
(TestInventory.assertInventoryEqual): Build the command from args
if not None.

* bzrlib/tests/blackbox/test_ls.py:
(TestLS.ls_equals): Build the command from args if not None.

* bzrlib/tests/blackbox/test_remove_tree.py:
(TestRemoveTree.test_remove_tree_lightweight_checkout_explicit):
Nice catch, we were calling run_bzr instead of run_bzr_error. This
went unnoticed for some time...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1337
1337
            if isinstance(args[0], (list, basestring)):
1338
1338
                args = args[0]
1339
1339
        else:
1340
 
            ## symbol_versioning.warn(zero_eighteen % "passing varargs to run_bzr",
1341
 
            ##         DeprecationWarning, stacklevel=2)
1342
 
            # not done yet, because too many tests would need to  be updated -
1343
 
            # but please don't do this in new code.  -- mbp 20070626
1344
 
            pass
 
1340
            symbol_versioning.warn(zero_eighteen % "passing varargs to run_bzr",
 
1341
                                   DeprecationWarning, stacklevel=3)
1345
1342
 
1346
1343
        out, err = self._run_bzr_autosplit(args=args,
1347
1344
            retcode=retcode,
1369
1366
        :param kwargs: Keyword arguments which are interpreted by run_bzr
1370
1367
            This function changes the default value of retcode to be 3,
1371
1368
            since in most cases this is run when you expect bzr to fail.
1372
 
        :return: (out, err) The actual output of running the command (in case you
1373
 
                 want to do more inspection)
 
1369
        :return: (out, err) The actual output of running the command (in case
 
1370
            you want to do more inspection)
1374
1371
 
1375
1372
        Examples of use:
1376
1373
            # Make sure that commit is failing because there is nothing to do
1383
1380
                               'commit', '--strict', '-m', 'my commit comment')
1384
1381
        """
1385
1382
        kwargs.setdefault('retcode', 3)
1386
 
        out, err = self.run_bzr(error_regexes=error_regexes, *args, **kwargs)
 
1383
        kwargs['error_regexes'] = error_regexes
 
1384
        out, err = self.run_bzr(*args, **kwargs)
1387
1385
        return out, err
1388
1386
 
1389
1387
    def run_bzr_subprocess(self, *args, **kwargs):