Michael Foord | 3ab34cc | 2010-12-03 12:27:40 +0000 | [diff] [blame] | 1 | from test import regrtest, support |
Michael Foord | ee4a5e0 | 2010-12-03 10:42:03 +0000 | [diff] [blame] | 2 | |
Michael Foord | ee4a5e0 | 2010-12-03 10:42:03 +0000 | [diff] [blame] | 3 | |
Michael Foord | 3ab34cc | 2010-12-03 12:27:40 +0000 | [diff] [blame] | 4 | TEMPDIR, TESTCWD = regrtest._make_temp_dir_for_build(regrtest.TEMPDIR) |
| 5 | regrtest.TEMPDIR = TEMPDIR |
Michael Foord | ee4a5e0 | 2010-12-03 10:42:03 +0000 | [diff] [blame] | 6 | regrtest.TESTCWD = TESTCWD |
| 7 | |
| 8 | # Run the tests in a context manager that temporary changes the CWD to a |
| 9 | # temporary and writable directory. If it's not possible to create or |
| 10 | # change the CWD, the original CWD will be used. The original CWD is |
| 11 | # available from support.SAVEDCWD. |
| 12 | with support.temp_cwd(TESTCWD, quiet=True): |
| 13 | regrtest.main() |