diff options
| author | John Vandenberg <jayvdb@gmail.com> | 2016-09-20 07:16:04 +0700 |
|---|---|---|
| committer | John Vandenberg <jayvdb@gmail.com> | 2016-09-20 07:16:04 +0700 |
| commit | 0159ddee602ece9075fc48aa019d0c4fa298e454 (patch) | |
| tree | 6427663427026902233e6d2776c45bb2c1ed456a /tests/test_basic_api.py | |
| parent | 56e75b33d66738b072f9f5525f3af4a8ba863d8b (diff) | |
| download | pygments-0159ddee602ece9075fc48aa019d0c4fa298e454.tar.gz | |
Provide explanation when a test is skipped
SkipTest messages are shown when running the test suite with
verbosity, such as `nosetests -v`.
They help the user see how to fix the problem, in order to
achieve higher coverage when running the test suite.
Diffstat (limited to 'tests/test_basic_api.py')
| -rw-r--r-- | tests/test_basic_api.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py index 022e6c55..03a452d7 100644 --- a/tests/test_basic_api.py +++ b/tests/test_basic_api.py @@ -161,8 +161,8 @@ def test_formatter_public_api(): try: inst = formatter(opt1="val1") - except (ImportError, FontNotFound): - raise support.SkipTest + except (ImportError, FontNotFound) as e: + raise support.SkipTest(e) try: inst.get_style_defs() @@ -209,9 +209,9 @@ def test_formatter_unicode_handling(): def verify(formatter): try: inst = formatter(encoding=None) - except (ImportError, FontNotFound): + except (ImportError, FontNotFound) as e: # some dependency or font not installed - raise support.SkipTest + raise support.SkipTest(e) if formatter.name != 'Raw tokens': out = format(tokens, inst) |
