diff options
| author | jvoisin | 2012-12-13 22:10:59 +0100 |
|---|---|---|
| committer | jvoisin | 2012-12-13 22:10:59 +0100 |
| commit | d937b7e865490a80c2bff0ca161288f323313c1b (patch) | |
| tree | ca3355f3ee91c5fa4266f0236e38706a2acfbe67 /test/test.py | |
| parent | e8f3ae69fc7e40fffdb8f755702eb11f86383e37 (diff) | |
Specify exceptions types
Diffstat (limited to 'test/test.py')
| -rw-r--r-- | test/test.py | 15 |
1 files 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 | |||
| 15 | import unittest | 15 | import unittest |
| 16 | import subprocess | 16 | import subprocess |
| 17 | import sys | 17 | import sys |
| 18 | import test | ||
| 19 | 18 | ||
| 20 | VERBOSITY = 3 | 19 | VERBOSITY = 3 |
| 21 | 20 | ||
| @@ -30,18 +29,18 @@ try: # PDF render processing | |||
| 30 | import poppler | 29 | import poppler |
| 31 | import cairo | 30 | import cairo |
| 32 | import pdfrw | 31 | import pdfrw |
| 33 | except: | 32 | except ImportError: |
| 34 | FILE_LIST.remove(('clean é.pdf', 'dirty é.pdf')) | 33 | FILE_LIST.remove(('clean é.pdf', 'dirty é.pdf')) |
| 35 | 34 | ||
| 36 | try: # python-mutagen : audio file format | 35 | try: # python-mutagen : audio file format |
| 37 | import mutagen | 36 | import mutagen |
| 38 | except: | 37 | except ImportError: |
| 39 | pass # since wr don't have any ogg for now | 38 | pass # since wr don't have any ogg for now |
| 40 | #FILE_LIST.remove(('clean.ogg', 'dirty.ogg')) | 39 | #FILE_LIST.remove(('clean.ogg', 'dirty.ogg')) |
| 41 | 40 | ||
| 42 | try: # file format exclusively managed by exiftool | 41 | try: # file format exclusively managed by exiftool |
| 43 | subprocess.Popen('exiftool', stdout=open('/dev/null')) | 42 | subprocess.Popen('exiftool', stdout=open('/dev/null')) |
| 44 | except: | 43 | except OSError: |
| 45 | pass # None for now | 44 | pass # None for now |
| 46 | 45 | ||
| 47 | 46 | ||
| @@ -73,11 +72,11 @@ def main(): | |||
| 73 | import clitest | 72 | import clitest |
| 74 | import libtest | 73 | import libtest |
| 75 | 74 | ||
| 76 | Suite = unittest.TestSuite() | 75 | suite = unittest.TestSuite() |
| 77 | Suite.addTests(clitest.get_tests()) | 76 | suite.addTests(clitest.get_tests()) |
| 78 | Suite.addTests(libtest.get_tests()) | 77 | suite.addTests(libtest.get_tests()) |
| 79 | 78 | ||
| 80 | unittest.TextTestRunner(verbosity=test.VERBOSITY).run(Suite) | 79 | unittest.TextTestRunner(verbosity=VERBOSITY).run(suite) |
| 81 | 80 | ||
| 82 | 81 | ||
| 83 | if __name__ == '__main__': | 82 | if __name__ == '__main__': |
