summaryrefslogtreecommitdiffstats
path: root/tests/test_errors.py
blob: c8cf4b05d35ea43b8ab9fb771f4fd22400f97f47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys

from sphinx.errors import ExtensionError


def test_extension_error_repr():
    exc = ExtensionError("foo")
    assert repr(exc) == "ExtensionError('foo')"


def test_extension_error_with_orig_exc_repr():
    exc = ExtensionError("foo", Exception("bar"))
    if sys.version_info < (3, 7):
        expected = "ExtensionError('foo', Exception('bar',))"
    else:
        expected = "ExtensionError('foo', Exception('bar'))"
    assert repr(exc) == expected