~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: Martin Pool
  • Date: 2005-09-13 01:12:11 UTC
  • Revision ID: mbp@sourcefrog.net-20050913011211-47c8a4f18ac40dda
- fix up import
- fix creation of test directory
- shorten test directory names by removing __main__

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import subprocess
25
25
import shutil
26
26
 
27
 
from testsweet import run_suite
 
27
import testsweet
28
28
import bzrlib.commands
29
29
 
30
30
import bzrlib.trace
193
193
            root = 'test%04d.tmp' % i
194
194
            try:
195
195
                os.mkdir(root)
196
 
            except IOError, e:
197
 
                if e.errno == errno.EEXISTS:
 
196
            except OSError, e:
 
197
                if e.errno == errno.EEXIST:
 
198
                    i += 1
198
199
                    continue
199
200
                else:
200
201
                    raise
210
211
        import os
211
212
        self._make_test_root()
212
213
        self._currentdir = os.getcwdu()
213
 
        short_id = self.id().replace('bzrlib.selftest.', '')
 
214
        short_id = self.id().replace('bzrlib.selftest.', '') \
 
215
                   .replace('__main__.', '')
214
216
        self.test_dir = os.path.join(self.TEST_ROOT, short_id)
215
217
        os.mkdir(self.test_dir)
216
218
        os.chdir(self.test_dir)
296
298
 
297
299
def selftest(verbose=False, pattern=".*"):
298
300
    """Run the whole test suite under the enhanced runner"""
299
 
    return run_suite(test_suite(), 'testbzr', verbose=verbose, pattern=pattern)
 
301
    return testsweet.run_suite(test_suite(), 'testbzr', verbose=verbose, pattern=pattern)
300
302
 
301
303
 
302
304
def test_suite():