diff options
author | Georg Brandl <georg@python.org> | 2012-09-29 07:27:15 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-09-29 07:27:15 (GMT) |
commit | 99a247fd01c1cd780c0c3ee1116657627f1ee744 (patch) | |
tree | 319e33cb6612c3fafb2eb82e15c5e85e3d771e4f /Lib/test/test_support.py | |
parent | 1628eaa5dc8892ff381ca7558cc7c8d80fac494d (diff) | |
parent | 8ed677db129171317b8ee7cd45b39b9013f5a2d6 (diff) | |
download | cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.zip cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.gz cpython-99a247fd01c1cd780c0c3ee1116657627f1ee744.tar.bz2 |
Merge with main repo default branch.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r-- | Lib/test/test_support.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 14fcdbf..f6ef5f6 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -95,6 +95,15 @@ class TestSupport(unittest.TestCase): self.assertFalse(os.path.exists(TESTFN)) self.assertTrue(os.path.basename(os.getcwd()), here) + def test_temp_cwd__chdir_warning(self): + """Check the warning message when os.chdir() fails.""" + path = TESTFN + '_does_not_exist' + with support.check_warnings() as recorder: + with support.temp_cwd(path=path, quiet=True): + pass + messages = [str(w.message) for w in recorder.warnings] + self.assertEqual(messages, ['tests may fail, unable to change the CWD to ' + path]) + def test_sortdict(self): self.assertEqual(support.sortdict({3:3, 2:2, 1:1}), "{1: 1, 2: 2, 3: 3}") |