diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-12-13 22:45:10 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-12-13 22:45:10 -0500 |
commit | 2df9b1c35cbb5c92204fc5923368a3d619a34f6d (patch) | |
tree | d1ede8ffef812ba4e345b08f698f001ebe69cb56 /tests/backunittest.py | |
parent | 84221611890880b749dbb650e8d07ac8918dba46 (diff) | |
parent | 7c66441eab3af17539c478a2cb4e19cd93ba0cf4 (diff) | |
download | python-coveragepy-git-2df9b1c35cbb5c92204fc5923368a3d619a34f6d.tar.gz |
Merged 4.0 to default
Diffstat (limited to 'tests/backunittest.py')
-rw-r--r-- | tests/backunittest.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/tests/backunittest.py b/tests/backunittest.py index 30da78eb..0964ab1d 100644 --- a/tests/backunittest.py +++ b/tests/backunittest.py @@ -1,8 +1,6 @@ """Implementations of unittest features from the future.""" -import difflib, re, sys, unittest - -from coverage.backward import set # pylint: disable=W0622 +import difflib, re, unittest def _need(method): @@ -17,18 +15,6 @@ class TestCase(unittest.TestCase): the builtin `unittest` doesn't have them. """ - if _need('assertTrue'): - def assertTrue(self, exp, msg=None): - """Assert that `exp` is true.""" - if not exp: - self.fail(msg) - - if _need('assertFalse'): - def assertFalse(self, exp, msg=None): - """Assert that `exp` is false.""" - if exp: - self.fail(msg) - if _need('assertIn'): def assertIn(self, member, container, msg=None): """Assert that `member` is in `container`.""" @@ -57,8 +43,7 @@ class TestCase(unittest.TestCase): """ try: callobj(*args, **kw) - except excClass: - _, exc, _ = sys.exc_info() + except excClass as exc: excMsg = str(exc) if re.search(regexp, excMsg): # Message provided, and we got the right one: it passes. |