summaryrefslogtreecommitdiff
path: root/tests/test_basic_api.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2008-07-26 15:41:24 +0200
committergbrandl <devnull@localhost>2008-07-26 15:41:24 +0200
commitb3386b73f66d1ddeedbcf5e02343e00c903182d3 (patch)
tree7f16e6a50cd0cdea7b16a69415652583c3406adb /tests/test_basic_api.py
parent606090106ed34fd6296631345a79e713a4e04ec9 (diff)
parentee945e89d09d0225db3de3c3314709113df4bc76 (diff)
downloadpygments-b3386b73f66d1ddeedbcf5e02343e00c903182d3.tar.gz
Merge from http://code.timhatch.com/hg/pygments-tim.
Diffstat (limited to 'tests/test_basic_api.py')
-rw-r--r--tests/test_basic_api.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py
index ab348cbc..50dbd943 100644
--- a/tests/test_basic_api.py
+++ b/tests/test_basic_api.py
@@ -15,6 +15,7 @@ import random
from pygments import lexers, formatters, filters, format
from pygments.token import _TokenType, Text
from pygments.lexer import RegexLexer
+from pygments.formatters.img import FontNotFound
test_content = [chr(i) for i in xrange(33, 128)] * 5
random.shuffle(test_content)
@@ -133,7 +134,7 @@ class FormattersTest(unittest.TestCase):
try:
inst = formatter(opt1="val1")
- except ImportError:
+ except (ImportError, FontNotFound):
continue
inst.get_style_defs()
inst.format(ts, out)
@@ -168,8 +169,8 @@ class FormattersTest(unittest.TestCase):
for formatter, info in formatters.FORMATTERS.iteritems():
try:
inst = formatter(encoding=None)
- except ImportError:
- # some dependency not installed
+ except (ImportError, FontNotFound):
+ # some dependency or font not installed
continue
out = format(tokens, inst)
if formatter.unicodeoutput: