Merge lp:~larstiq/bzr/xdg-config into lp:bzr/2.5

Proposed by Wouter van Heyst
Status: Merged
Approved by: Martin Packman
Approved revision: no longer in the source branch.
Merged at revision: 6495
Proposed branch: lp:~larstiq/bzr/xdg-config
Merge into: lp:bzr/2.5
Diff against target: 11 lines (+1/-0)
1 file modified
bzrlib/tests/test_config.py (+1/-0)
To merge this branch: bzr merge lp:~larstiq/bzr/xdg-config
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Review via email: mp+104068@code.launchpad.net

Commit message

Isolate config dir test from XDG_CONFIG_HOME

Description of the change

I actually have XDG_CONFIG_HOME set, which broke bzrlib.tests.test_config.TestXDGConfigDir.test_xdg_config_dir_exists.

This change unsets XDG_CONFIG_HOME from the environment at the start of that test.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve
Revision history for this message
Martin Packman (gz) wrote :

sent to pqm by email

Revision history for this message
Vincent Ladeuil (vila) wrote :

Argh, too late :-(

This should be taken care of for *all* tests as all other env variables in tests/__init__.py

Revision history for this message
Martin Packman (gz) wrote :

Wouter could always do another mp with more env changes, if you point him in the right direction. :)

Revision history for this message
Vincent Ladeuil (vila) wrote :

@Larstiq: look for isolated_environ in bzrlib/tests/__init__.py, the comment should be reasonably clear, if not, feel free to tweak it ;)

Basically, it's a list of env vars that should be cleared/set to properly isolate the tests from the running env. Your patch here does exactly that for a single test.

Revision history for this message
Wouter van Heyst (larstiq) wrote :

Thanks Vincent, fixed properly now :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/test_config.py'
2--- bzrlib/tests/test_config.py 2012-03-26 17:01:21 +0000
3+++ bzrlib/tests/test_config.py 2012-04-30 08:13:24 +0000
4@@ -611,6 +611,7 @@
5
6 def test_xdg_config_dir_exists(self):
7 """When ~/.config/bazaar exists, use it as the config dir."""
8+ self.overrideEnv('XDG_CONFIG_HOME', None)
9 newdir = osutils.pathjoin(self.test_home_dir, '.config', 'bazaar')
10 os.makedirs(newdir)
11 self.assertEqual(config.config_dir(), newdir)

Subscribers

People subscribed via source and target branches