summaryrefslogtreecommitdiff
path: root/tests/unit/test_cli.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-06-25 10:02:53 -0700
committerJohn L. Villalovos <john@sodarock.com>2022-06-25 10:02:53 -0700
commit7577c91c5819c8f37acbf4d4c3eee3ffd84522a0 (patch)
treec48fc0d5263ed1956b2febee96bab4d5ad323b6f /tests/unit/test_cli.py
parentf9b7c7b5c1c5782ffe1cec19420f3484681e1a67 (diff)
downloadgitlab-jlvillal/version_in_keyerror.tar.gz
chore: add the version of python-gitlab to GitlabErrorjlvillal/version_in_keyerror
People will post tracebacks of exceptions but not post information on the version of python-gitlab used. Add the version of python-gitlab to the GitlabError exception message.
Diffstat (limited to 'tests/unit/test_cli.py')
-rw-r--r--tests/unit/test_cli.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py
index ef33b5d..769b087 100644
--- a/tests/unit/test_cli.py
+++ b/tests/unit/test_cli.py
@@ -24,8 +24,7 @@ from contextlib import redirect_stderr # noqa: H302
import pytest
-from gitlab import cli
-from gitlab.exceptions import GitlabError
+from gitlab import cli, exceptions
@pytest.mark.parametrize(
@@ -71,7 +70,7 @@ def test_cls_to_gitlab_resource(class_name, expected_gitlab_resource):
"message,error,expected",
[
("foobar", None, "foobar\n"),
- ("foo", GitlabError("bar"), "foo (bar)\n"),
+ ("foo", exceptions.GitlabError("bar"), f"foo (bar{exceptions._PG_VERSION})\n"),
],
)
def test_die(message, error, expected):