/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Robert Collins
  • Date: 2008-08-14 06:46:29 UTC
  • mfrom: (3628 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3629.
  • Revision ID: robertc@robertcollins.net-20080814064629-wuzmbxzw7tn27usi
Resolve conflicts in NEWS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1196
1196
        """Make the logfile not be deleted when _finishLogFile is called."""
1197
1197
        self._keep_log_file = True
1198
1198
 
1199
 
    def addCleanup(self, callable):
 
1199
    def addCleanup(self, callable, *args, **kwargs):
1200
1200
        """Arrange to run a callable when this case is torn down.
1201
1201
 
1202
1202
        Callables are run in the reverse of the order they are registered, 
1203
1203
        ie last-in first-out.
1204
1204
        """
1205
 
        if callable in self._cleanups:
1206
 
            raise ValueError("cleanup function %r already registered on %s" 
1207
 
                    % (callable, self))
1208
 
        self._cleanups.append(callable)
 
1205
        self._cleanups.append((callable, args, kwargs))
1209
1206
 
1210
1207
    def _cleanEnvironment(self):
1211
1208
        new_env = {
1320
1317
        # Actually pop the cleanups from the list so tearDown running
1321
1318
        # twice is safe (this happens for skipped tests).
1322
1319
        while self._cleanups:
1323
 
            self._cleanups.pop()()
 
1320
            cleanup, args, kwargs = self._cleanups.pop()
 
1321
            cleanup(*args, **kwargs)
1324
1322
 
1325
1323
    def log(self, *args):
1326
1324
        mutter(*args)
1591
1589
            # so we will avoid using it on all platforms, just to
1592
1590
            # make sure the code path is used, and we don't break on win32
1593
1591
            cleanup_environment()
1594
 
            command = [sys.executable, bzr_path]
 
1592
            command = [sys.executable]
 
1593
            # frozen executables don't need the path to bzr
 
1594
            if getattr(sys, "frozen", None) is None:
 
1595
                command.append(bzr_path)
1595
1596
            if not allow_plugins:
1596
1597
                command.append('--no-plugins')
1597
1598
            command.extend(process_args)