classification
Title: Add temp_dir() and change_cwd() to test.support
Type: enhancement Stage: patch review
Components: Tests Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: ncoghlan Nosy List: brett.cannon, chris.jerdonek, eric.snow, ezio.melotti, flox, ncoghlan
Priority: normal Keywords: easy, patch

Created on 2012-07-21 21:13 by chris.jerdonek, last changed 2012-11-13 06:22 by eric.snow.

Files
File name Uploaded Description Edit
issue-15415-1.patch chris.jerdonek, 2012-07-21 21:53
issue-15415-2.patch chris.jerdonek, 2012-07-21 22:05
issue-15415-3.patch chris.jerdonek, 2012-07-21 23:20 review
Messages (4)
msg166071 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-21 21:13
This issue is partly in service to issue 15376, which is to refactor test_runpy's walk_package support code into a common location.

Currently, the temp_cwd() context manager in test.support does two things: it creates a temp directory, and it changes the current working directory.

It would be useful and clearer if test.support exposed these two things as separate context managers.  This will both let us simplify the implementation of temp_cwd() and give us an opportunity to increase code reuse between test.support and test.script_helper.  (Currently, test.script_helper has its own version of temp_dir(), whose functionality overlaps with temp_cwd().)

I will upload a patch shortly with tests.
msg166080 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-21 21:53
Attaching a patch with tests.
msg166083 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-21 22:05
Fixing patch so it will apply cleanly.
msg166089 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-21 23:20
Trying again to have the patch apply cleanly (for the review link).
History
Date User Action Args
2012-11-13 06:22:36eric.snowsetnosy: + eric.snow
2012-09-19 14:24:51brett.cannonsetnosy: + brett.cannon
2012-09-19 00:31:49ezio.melottisetnosy: + ezio.melotti, flox
type: enhancement
2012-07-30 10:27:46ncoghlanlinkissue15376 dependencies
2012-07-26 02:18:59ncoghlansetassignee: ncoghlan

nosy: + ncoghlan
2012-07-21 23:20:48chris.jerdoneksetfiles: + issue-15415-3.patch

messages: + msg166089
2012-07-21 22:05:12chris.jerdoneksetfiles: + issue-15415-2.patch

messages: + msg166083
2012-07-21 21:53:29chris.jerdoneksetfiles: + issue-15415-1.patch
keywords: + patch
messages: + msg166080

stage: patch review
2012-07-21 21:13:18chris.jerdonekcreate