# HG changeset patch # User Matt Mackall # Date 1406839740 18000 # Node ID bcc8390d7819b22fa699e2a0bda6635a818cf079 # Parent 838c5a91ed44afb1170495e859ba54413daf58ad tests: remove "with" usage for 2.4 compatibility diff -r 838c5a91ed44 -r bcc8390d7819 tests/test-hidden.py --- a/tests/test-hidden.py Thu Jul 31 15:30:51 2014 -0500 +++ b/tests/test-hidden.py Thu Jul 31 15:49:00 2014 -0500 @@ -9,8 +9,8 @@ f.close() self.client.add('gna1') cs = self.client.commit('gna1')[1] #get id - with self.assertRaises(CommandError): - self.client.rawcommand(['debugobsolete', cs]) + self.assertRaises(CommandError, + self.client.rawcommand, ['debugobsolete', cs]) class test_obsolete_baselib(common.basetest): diff -r 838c5a91ed44 -r bcc8390d7819 tests/test-phase.py --- a/tests/test-phase.py Thu Jul 31 15:30:51 2014 -0500 +++ b/tests/test-phase.py Thu Jul 31 15:49:00 2014 -0500 @@ -23,8 +23,8 @@ """test phase change from draft to secret""" self.append('a', 'a') rev, node0 = self.client.commit('first', addremove=True) - with self.assertRaises(hglib.error.CommandError): - self.client.phase(node0, secret=True) + self.assertRaises(hglib.error.CommandError, + self.client.phase, node0, secret=True) self.client.phase(node0, secret=True, force=True) self.assertEqual([(0, 'secret')], self.client.phase(node0)) ctx = self.client[rev]