From 1ecd56461b588acff1d1fe88b6e78a4e71957252 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Tue, 19 Jul 2016 12:55:10 +0200 Subject: [PATCH] fail unittest if expected exception does not happen; close tar in any case --- testing/test_multivol.py | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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") -- 1.7.1