Ezio Melotti <ezio.melo...@gmail.com> added the comment:

The patch looks good, I'd just move _test_cwd inside the function and drop the 
[:-3] from TESTFN, but apart from that it's OK. I also agree that 
functools.wraps should be added.

To summarize the discussion we had on #python-dev:
1) the context manager should always create a writable cwd and to be able to 
run with -J it should contain the process id. Using TESTFN as first-level dir 
solves both the issues;
2) a suffix is added to TESTFN to let the tests use TESTFN as a valid filename;
3) the second-level dir is 'tempcwd' by default or can be passed to the 
function in case a test needs a specific name for the cwd;

The result will be something like '@test_xxxx_tmp_cwd/dirname'.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7712>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to