Rev 4575: os.SEEK_SET isn't available on python 2.4, duplicate the constant for subunit support. in http://people.canonical.com/~robertc/baz2.0/integration
Robert Collins
robertc at robertcollins.net
Thu Jul 30 00:39:14 BST 2009
At http://people.canonical.com/~robertc/baz2.0/integration
------------------------------------------------------------
revno: 4575
revision-id: robertc at robertcollins.net-20090729233909-f6r7ir05iwljf2dy
parent: robertc at robertcollins.net-20090728214959-z0z01q2m47phmkcw
committer: Robert Collins <robertc at robertcollins.net>
branch nick: integration
timestamp: Thu 2009-07-30 09:39:09 +1000
message:
os.SEEK_SET isn't available on python 2.4, duplicate the constant for subunit support.
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2009-07-28 21:49:59 +0000
+++ b/bzrlib/tests/__init__.py 2009-07-29 23:39:09 +0000
@@ -113,6 +113,11 @@
default_transport = LocalURLServer
+# Constants for integrating with subunit; duplicated here to avoid having a
+# hard dependency on subunit.
+SUBUNIT_SET = 0
+SUBUNIT_CUR = 1
+
class ExtendedTestResult(unittest._TextTestResult):
"""Accepts, reports and accumulates the results of running tests.
@@ -360,9 +365,9 @@
def progress(self, offset, whence):
"""The test is adjusting the count of tests to run."""
- if whence == os.SEEK_SET:
+ if whence == SUBUNIT_SET:
self.num_tests = offset
- elif whence == os.SEEK_CUR:
+ elif whence == SUBUNIT_CUR:
self.num_tests += offset
else:
raise errors.BzrError("Unknown whence %r" % whence)
More information about the bazaar-commits
mailing list