summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_exceptions.py
diff options
context:
space:
mode:
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)