~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-13 21:14:39 UTC
  • mfrom: (2321.3.10 selftest.win32-0.16)
  • Revision ID: pqm@pqm.ubuntu.com-20070313211439-de065881d219e0dd
(bialix) fixes for selftest on win32

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
    def printErrorList(self, flavour, errors):
273
273
        for test, err in errors:
274
274
            self.stream.writeln(self.separator1)
275
 
            self.stream.writeln("%s: %s" % (flavour, self.getDescription(test)))
 
275
            self.stream.write("%s: " % flavour)
 
276
            if NUMBERED_DIRS:
 
277
                self.stream.write('#%d ' % test.number)
 
278
            self.stream.writeln(self.getDescription(test))
276
279
            if getattr(test, '_get_log', None) is not None:
277
280
                print >>self.stream
278
281
                print >>self.stream, \
1695
1698
        """Fail if path does not contain 'content'."""
1696
1699
        self.failUnlessExists(path)
1697
1700
        # TODO: jam 20060427 Shouldn't this be 'rb'?
1698
 
        self.assertEqualDiff(content, open(path, 'r').read())
 
1701
        f = file(path, 'r')
 
1702
        try:
 
1703
            s = f.read()
 
1704
        finally:
 
1705
            f.close()
 
1706
        self.assertEqualDiff(content, s)
1699
1707
 
1700
1708
    def failUnlessExists(self, path):
1701
1709
        """Fail unless path, which may be abs or relative, exists."""