diff options
author | gbrandl <devnull@localhost> | 2008-07-23 16:06:32 +0200 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2008-07-23 16:06:32 +0200 |
commit | 34c7f4b6176300a0c4dba12c6dfea51ec9e92ed8 (patch) | |
tree | 591827cec92b606cc201cde795d22b866f65739d /tests/test_basic_api.py | |
parent | 55abdeec16380cd071a8f4ea715163244f504097 (diff) | |
download | pygments-34c7f4b6176300a0c4dba12c6dfea51ec9e92ed8.tar.gz |
Ignore failure when default font is not installed.
Diffstat (limited to 'tests/test_basic_api.py')
-rw-r--r-- | tests/test_basic_api.py | 7 |
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: |