We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 16f604b + 94e5310 commit d1beee5Copy full SHA for d1beee5
1 file changed
test/test_utils.py
@@ -813,12 +813,9 @@ class PushdTest(unittest.TestCase):
813
def test_restore_cwd(self):
814
"Ensure do_command in a different cwd restores cwd after error."
815
cwd = os.getcwd()
816
- try:
817
- with self.assertRaises(RuntimeError):
818
- with pushd(os.path.dirname(cwd)):
819
- raise RuntimeError('error')
820
- except RuntimeError:
821
- pass
+ with self.assertRaises(RuntimeError):
+ with pushd(os.path.dirname(cwd)):
+ raise RuntimeError('error')
822
self.assertEqual(cwd, os.getcwd())
823
824
0 commit comments