summaryrefslogtreecommitdiff
path: root/tests/test_errors.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-09-29 21:12:40 +0900
committerGitHub <noreply@github.com>2018-09-29 21:12:40 +0900
commit973c3ffa25f6f14e53382f7a45ffbeee9d252b3c (patch)
treed4d500f2dad3bbdab82820f1f4bb2ae5bc97a6ff /tests/test_errors.py
parentabcb5bd5eca6ea46ffcc34a55b663083d03f339c (diff)
parentd2c3d54bb9a46c5e7a0d14c3345e489d7592de9a (diff)
downloadsphinx-git-973c3ffa25f6f14e53382f7a45ffbeee9d252b3c.tar.gz
Merge branch 'master' into change_master_doc_to_index
Diffstat (limited to 'tests/test_errors.py')
-rw-r--r--tests/test_errors.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_errors.py b/tests/test_errors.py
new file mode 100644
index 000000000..c8cf4b05d
--- /dev/null
+++ b/tests/test_errors.py
@@ -0,0 +1,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