Skip to content

Commit d1beee5

Browse files
committed
Merge branch 'do-cmd-restore-cwd' of github.com:stan-dev/cmdstanpy into do-cmd-restore-cwd
2 parents 16f604b + 94e5310 commit d1beee5

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

test/test_utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,9 @@ class PushdTest(unittest.TestCase):
813813
def test_restore_cwd(self):
814814
"Ensure do_command in a different cwd restores cwd after error."
815815
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
816+
with self.assertRaises(RuntimeError):
817+
with pushd(os.path.dirname(cwd)):
818+
raise RuntimeError('error')
822819
self.assertEqual(cwd, os.getcwd())
823820

824821

0 commit comments

Comments
 (0)