Merge lp:~cjwatson/launchpadlib/isolate-doctests into lp:launchpadlib

Proposed by Colin Watson
Status: Merged
Merged at revision: 158
Proposed branch: lp:~cjwatson/launchpadlib/isolate-doctests
Merge into: lp:launchpadlib
Diff against target: 55 lines (+21/-1)
3 files modified
src/launchpadlib/NEWS.txt (+4/-0)
src/launchpadlib/__init__.py (+1/-1)
src/launchpadlib/docs/introduction.txt (+16/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpadlib/isolate-doctests
Reviewer Review Type Date Requested Status
Barry Warsaw Approve
Review via email: mp+316081@code.launchpad.net

Commit message

Stop introduction.txt doctest from writing to $HOME.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/launchpadlib/NEWS.txt'
2--- src/launchpadlib/NEWS.txt 2016-07-12 16:09:19 +0000
3+++ src/launchpadlib/NEWS.txt 2017-02-01 09:36:51 +0000
4@@ -2,6 +2,10 @@
5 NEWS for launchpadlib
6 =====================
7
8+1.10.5
9+======
10+- Stop introduction.txt doctest from writing to $HOME.
11+
12 1.10.4 (2016-07-12)
13 ===================
14 - Fix _bad_oauth_token crash on Python 3. [bug=1471894]
15
16=== modified file 'src/launchpadlib/__init__.py'
17--- src/launchpadlib/__init__.py 2016-07-12 16:09:19 +0000
18+++ src/launchpadlib/__init__.py 2017-02-01 09:36:51 +0000
19@@ -14,4 +14,4 @@
20 # You should have received a copy of the GNU Lesser General Public License
21 # along with launchpadlib. If not, see <http://www.gnu.org/licenses/>.
22
23-__version__ = '1.10.4'
24+__version__ = '1.10.5'
25
26=== modified file 'src/launchpadlib/docs/introduction.txt'
27--- src/launchpadlib/docs/introduction.txt 2016-07-12 16:08:43 +0000
28+++ src/launchpadlib/docs/introduction.txt 2017-02-01 09:36:51 +0000
29@@ -6,6 +6,20 @@
30 services API. It is officially supported by Canonical, although third party
31 packages may be available to provide bindings to other programming languages.
32
33+Set up
34+======
35+
36+launchpadlib writes to $HOME, so isolate ourselves.
37+
38+ >>> from fixtures import (
39+ ... EnvironmentVariable,
40+ ... TempDir,
41+ ... )
42+ >>> tempdir_fixture = TempDir()
43+ >>> tempdir_fixture.setUp()
44+ >>> home_fixture = EnvironmentVariable('HOME', tempdir_fixture.path)
45+ >>> home_fixture.setUp()
46+
47 OAuth authentication
48 ====================
49
50@@ -396,3 +410,5 @@
51 ========
52
53 >>> os.remove(path)
54+ >>> home_fixture.cleanUp()
55+ >>> tempdir_fixture.cleanUp()

Subscribers

People subscribed via source and target branches