Skip to content

Commit 046b2d9

Browse files
committed
More review feedback, thanks!
1 parent 5879e44 commit 046b2d9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Lib/test/test_contextlib.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,9 +1366,7 @@ def test_failed_chdir(self):
13661366
target = self.make_relative_path('non_existent_directory')
13671367
self.assertNotEqual(old_cwd, target)
13681368
ctx = chdir(target)
1369-
with self.assertRaises(OSError):
1370-
with ctx:
1371-
self.fail("chdir should have raised an exception")
1369+
self.assertRaises(OSError, ctx.__enter__)
13721370
self.assertFalse(ctx._old_cwd)
13731371
self.assertEqual(os.getcwd(), old_cwd)
13741372

0 commit comments

Comments
 (0)