summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_exceptions.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2020-04-17 02:26:28 +0200
committerNejc Habjan <nejc.habjan@siemens.com>2020-08-22 20:09:52 +0200
commit76b2cadf1418e4ea2ac420ebba5a4b4f16fbd4c7 (patch)
tree4dbe6ae57c4f03e1351f7a49e590cbbc6d31121a /gitlab/tests/test_exceptions.py
parent11383e70f74c70e6fe8a56f18b5b170db982f402 (diff)
downloadgitlab-76b2cadf1418e4ea2ac420ebba5a4b4f16fbd4c7.tar.gz
refactor: split unit tests by GitLab API resources
Diffstat (limited to 'gitlab/tests/test_exceptions.py')
-rw-r--r--gitlab/tests/test_exceptions.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/gitlab/tests/test_exceptions.py b/gitlab/tests/test_exceptions.py
index 57622c0..57b394b 100644
--- a/gitlab/tests/test_exceptions.py
+++ b/gitlab/tests/test_exceptions.py
@@ -1,20 +1,18 @@
-import unittest
+import pytest
from gitlab import exceptions
-import pytest
-class TestExceptions(unittest.TestCase):
- def test_error_raises_from_http_error(self):
- """Methods decorated with @on_http_error should raise from GitlabHttpError."""
+def test_error_raises_from_http_error():
+ """Methods decorated with @on_http_error should raise from GitlabHttpError."""
- class TestError(Exception):
- pass
+ class TestError(Exception):
+ pass
- @exceptions.on_http_error(TestError)
- def raise_error_from_http_error():
- raise exceptions.GitlabHttpError
+ @exceptions.on_http_error(TestError)
+ def raise_error_from_http_error():
+ raise exceptions.GitlabHttpError
- with pytest.raises(TestError) as context:
- raise_error_from_http_error()
- assert isinstance(context.value.__cause__, exceptions.GitlabHttpError)
+ with pytest.raises(TestError) as context:
+ raise_error_from_http_error()
+ assert isinstance(context.value.__cause__, exceptions.GitlabHttpError)