Merge lp:~gary/launchpad/small into lp:launchpad

Proposed by Gary Poster
Status: Merged
Approved by: Gary Poster
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~gary/launchpad/small
Merge into: lp:launchpad
Diff against target: 23 lines (+6/-7)
1 file modified
lib/canonical/launchpad/scripts/tests/test_logger.txt (+6/-7)
To merge this branch: bzr merge lp:~gary/launchpad/small
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+23052@code.launchpad.net

Commit message

update a test to work with the new buildout approach. Problem only exhibited in some circumstances.

Description of the change

This branch updates a test to work with the new buildout approach: you only need to include parts/scripts in PYTHONPATH in order to get the dependencies included, and PYTHONPATH is in fact already set up for you. Before my branch, this test failed only under certain circumstances, which is why it was not caught earlier.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/scripts/tests/test_logger.txt'
2--- lib/canonical/launchpad/scripts/tests/test_logger.txt 2009-06-12 16:36:02 +0000
3+++ lib/canonical/launchpad/scripts/tests/test_logger.txt 2010-04-08 22:13:22 +0000
4@@ -7,13 +7,12 @@
5 ... import sys
6 ... import subprocess
7 ... from canonical.config import config
8- ... # We want to make sure that the subprocess will have the benefit
9- ... # of all of the dependency paths inserted by the buildout.
10- ... # We pass them via PYTHONPATH.
11- ... env = kw.get('env')
12- ... if env is None:
13- ... kw['env'] = env = dict(os.environ)
14- ... env['PYTHONPATH'] = os.path.pathsep.join(sys.path)
15+ ... if 'env' in kw:
16+ ... # We want to make sure that the subprocess will have the
17+ ... # benefit of all of the dependency paths inserted by the
18+ ... # buildout. This is already set up in our environment's
19+ ... # PYTHONPATH, so use it.
20+ ... kw['env']['PYTHONPATH'] = os.environ['PYTHONPATH']
21 ... test_script_path = os.path.join(
22 ... config.root, 'lib', 'canonical', 'launchpad',
23 ... 'scripts', 'tests', 'loglevels.py')