From: Christian Herdtweck Date: Tue, 19 Jul 2016 10:55:10 +0000 (+0200) Subject: fail unittest if expected exception does not happen; close tar in any case X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=1ecd56461b588acff1d1fe88b6e78a4e71957252;p=python-delta-tar fail unittest if expected exception does not happen; close tar in any case --- diff --git a/testing/test_multivol.py b/testing/test_multivol.py index 580ec97..5ee71f9 100644 --- a/testing/test_multivol.py +++ b/testing/test_multivol.py @@ -756,9 +756,11 @@ class MultivolGnuFormatTest(BaseTest): new_volume_handler=new_volume_handler2) try: tarobj.extractall() + self.fail('should have raised an OSError') except OSError as e: pass - tarobj.close() + finally: + tarobj.close() assert os.path.exists("big") assert hash != self.md5sum("big")