Patchwork [hglib] tests: remove usage of assertRaisesRegexp

login
register
mail settings
Submitter Alexander Plavin
Date May 2, 2013, 9:18 p.m.
Message ID <5347c16a690287f2849f.1367529531@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1534/
State Accepted, archived
Headers show

Comments

Alexander Plavin - May 2, 2013, 9:18 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1367518276 -14400
#      Thu May 02 22:11:16 2013 +0400
# Node ID 5347c16a690287f2849fbe47e2f12effe3f3d0b4
# Parent  c635e6e7054f2600d36343eaa1770cb36549382a
tests: remove usage of assertRaisesRegexp

Usage of assertRaisesRegexp caused tests to fail on python versions prior to 2.7
Matt Mackall - May 2, 2013, 9:29 p.m.
On Fri, 2013-05-03 at 01:18 +0400, Alexander Plavin wrote:
> # HG changeset patch
> # User Alexander Plavin <me@aplavin.ru>
> # Date 1367518276 -14400
> #      Thu May 02 22:11:16 2013 +0400
> # Node ID 5347c16a690287f2849fbe47e2f12effe3f3d0b4
> # Parent  c635e6e7054f2600d36343eaa1770cb36549382a
> tests: remove usage of assertRaisesRegexp

Queued for hglib, thanks.

Patch

diff -r c635e6e7054f -r 5347c16a6902 tests/test-context.py
--- a/tests/test-context.py	Fri Apr 26 01:46:08 2013 +0400
+++ b/tests/test-context.py	Thu May 02 22:11:16 2013 +0400
@@ -4,7 +4,7 @@ 
 
 class test_context(common.basetest):
     def test_non_existent(self):
-        self.assertRaisesRegexp(ValueError, 'not found', context.changectx, self.client, 'foo')
+        self.assertRaises(ValueError, context.changectx, self.client, 'foo')
 
     def test_basic(self):
         self.append('a', 'a')