Merge lp:~jelmer/brz/fix-doctest into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Merge reported by: Jelmer Vernooij
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/fix-doctest
Merge into: lp:brz
Diff against target: 19 lines (+2/-1)
1 file modified
breezy/tests/__init__.py (+2/-1)
To merge this branch: bzr merge lp:~jelmer/brz/fix-doctest
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+331985@code.launchpad.net

Description of the change

Set BRZ_HOME to /nonexistant to prevent the user's configuration from leaking out in doctests.

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

Heh, the doctest isolation is getting closer to the standard unit test each time we touch it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/__init__.py'
2--- breezy/tests/__init__.py 2017-08-31 06:17:11 +0000
3+++ breezy/tests/__init__.py 2017-10-07 18:11:55 +0000
4@@ -195,7 +195,7 @@
5
6 def override_os_environ(test, env=None):
7 """Modify os.environ keeping a copy.
8-
9+
10 :param test: A test instance
11
12 :param env: A dict containing variable definitions to be installed
13@@ -897,6 +897,7 @@
14
15 def isolated_doctest_setUp(test):
16 override_os_environ(test)
17+ osutils.set_or_unset_env('BRZ_HOME', '/nonexistent')
18 test._orig_ui_factory = ui.ui_factory
19 ui.ui_factory = ui.SilentUIFactory()
20

Subscribers

People subscribed via source and target branches