From d937b7e865490a80c2bff0ca161288f323313c1b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 13 Dec 2012 22:10:59 +0100 Subject: Specify exceptions types --- test/test.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/test.py b/test/test.py index de6048c..cbee609 100644 --- a/test/test.py +++ b/test/test.py @@ -15,7 +15,6 @@ import tempfile import unittest import subprocess import sys -import test VERBOSITY = 3 @@ -30,18 +29,18 @@ try: # PDF render processing import poppler import cairo import pdfrw -except: +except ImportError: FILE_LIST.remove(('clean é.pdf', 'dirty é.pdf')) try: # python-mutagen : audio file format import mutagen -except: +except ImportError: pass # since wr don't have any ogg for now #FILE_LIST.remove(('clean.ogg', 'dirty.ogg')) try: # file format exclusively managed by exiftool subprocess.Popen('exiftool', stdout=open('/dev/null')) -except: +except OSError: pass # None for now @@ -73,11 +72,11 @@ def main(): import clitest import libtest - Suite = unittest.TestSuite() - Suite.addTests(clitest.get_tests()) - Suite.addTests(libtest.get_tests()) + suite = unittest.TestSuite() + suite.addTests(clitest.get_tests()) + suite.addTests(libtest.get_tests()) - unittest.TextTestRunner(verbosity=test.VERBOSITY).run(Suite) + unittest.TextTestRunner(verbosity=VERBOSITY).run(suite) if __name__ == '__main__': -- cgit v1.3