Rev 5936: Preserve $HOME/.bzr.log from tests in file:///home/vila/src/bzr/bugs/789505-test-tariff-logs/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Sat May 28 10:51:18 UTC 2011
At file:///home/vila/src/bzr/bugs/789505-test-tariff-logs/
------------------------------------------------------------
revno: 5936
revision-id: v.ladeuil+lp at free.fr-20110528105118-h2w9jq34e2ql8eqv
parent: pqm at pqm.ubuntu.com-20110528072339-sz8zc51i8sv71lgx
fixes bug(s): https://launchpad.net/bugs/789505
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 789505-test-tariff-logs
timestamp: Sat 2011-05-28 12:51:18 +0200
message:
Preserve $HOME/.bzr.log from tests
-------------- next part --------------
=== modified file 'bzrlib/tests/test_import_tariff.py'
--- a/bzrlib/tests/test_import_tariff.py 2011-05-27 14:50:58 +0000
+++ b/bzrlib/tests/test_import_tariff.py 2011-05-28 10:51:18 +0000
@@ -20,6 +20,10 @@
import os
from testtools import content
+from bzrlib import (
+ osutils,
+ trace,
+ )
from bzrlib.bzrdir import BzrDir
from bzrlib.smart import medium
from bzrlib.transport import remote
@@ -61,6 +65,15 @@
'BZR_PLUGINS_AT', 'HOME'):
self.preserved_env_vars[name] = os.environ.get(name)
super(TestImportTariffs, self).setUp()
+ self.log_path = osutils.pathjoin(self.test_home_dir, '.bzr.log')
+ self.overrideEnv('BZR_LOG', self.log_path)
+
+ def test_log_path_overriden(self):
+ # ensure we get the log file in the right place
+ actual_log_path = trace._get_bzr_log_filename()
+ self.assertStartsWith(actual_log_path, self.test_home_dir)
+ self.assertEquals(self.log_path, actual_log_path)
+
def start_bzr_subprocess_with_import_check(self, args, stderr_file=None):
"""Run a bzr process and capture the imports.
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-05-28 06:44:01 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-05-28 10:51:18 +0000
@@ -78,6 +78,9 @@
suite. This can include new facilities for writing tests, fixes to
spurious test failures and changes to the way things should be tested.
+* Don't use ``$HOME/.bzr.log`` for the TestImportTariffs tests.
+ (Vincent Ladeuil, #789505)
+
* Fix deadlock in `TestImportTariffs.test_simple_serve` when stderr gets
more output than fits in the default buffer. This was happening on the
Windows buildslave, and could easily happen in other circumstances where
More information about the bazaar-commits
mailing list