Rev 5582: Set HOME to None in isolated_environ and rename DocTestSuite to BzrDocTestSuite to reduce confusion (I still think it's a bad name space usage :) in file:///home/vila/src/bzr/bugs/test-isolation/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Dec 23 08:29:27 GMT 2010
At file:///home/vila/src/bzr/bugs/test-isolation/
------------------------------------------------------------
revno: 5582
revision-id: v.ladeuil+lp at free.fr-20101223082927-tle4a96tsgh80g2a
parent: v.ladeuil+lp at free.fr-20101221092126-lltuzt8p6cb1qdzo
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 321320-isolate-doc-tests
timestamp: Thu 2010-12-23 09:29:27 +0100
message:
Set HOME to None in isolated_environ and rename DocTestSuite to BzrDocTestSuite to reduce confusion (I still think it's a bad name space usage :)
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2010-12-21 09:21:26 +0000
+++ b/bzrlib/tests/__init__.py 2010-12-23 08:29:27 +0000
@@ -131,7 +131,7 @@
# few exceptions but you shouldn't violate this rule lightly.
isolated_environ = {
'BZR_HOME': None,
- 'HOME': os.getcwd(),
+ 'HOME': None,
# bzr now uses the Win32 API and doesn't rely on APPDATA, but the
# tests do check our impls match APPDATA
'BZR_EDITOR': None, # test_msgeditor manipulates this variable
@@ -882,7 +882,7 @@
-def DocTestSuite(*args, **kwargs):
+def BzrDocTestSuite(*args, **kwargs):
"""Overrides doctest.DocTestSuite to handle isolation.
The method is really a factory and users are expected to use it as such.
@@ -3958,7 +3958,7 @@
try:
# note that this really does mean "report only" -- doctest
# still runs the rest of the examples
- doc_suite = DocTestSuite(
+ doc_suite = BzrDocTestSuite(
mod, optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)
except ValueError, e:
print '**failed to get doctest for: %s\n%s' % (mod, e)
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2010-12-18 19:00:12 +0000
+++ b/bzrlib/tests/test_selftest.py 2010-12-23 08:29:27 +0000
@@ -3562,7 +3562,7 @@
# doctest.DocTestSuite fails as it sees '25'
self.assertDocTestStringFails(doctest.DocTestSuite, test)
# tests.DocTestSuite sees '42'
- self.assertDocTestStringSucceds(tests.DocTestSuite, test)
+ self.assertDocTestStringSucceds(tests.BzrDocTestSuite, test)
def test_deleted_variable(self):
self.overrideAttr(tests, 'isolated_environ', {'LINES': None})
@@ -3573,4 +3573,4 @@
# doctest.DocTestSuite fails as it sees '25'
self.assertDocTestStringFails(doctest.DocTestSuite, test)
# tests.DocTestSuite sees None
- self.assertDocTestStringSucceds(tests.DocTestSuite, test)
+ self.assertDocTestStringSucceds(tests.BzrDocTestSuite, test)
More information about the bazaar-commits
mailing list