Skip to content
Snippets Groups Projects
Commit 85f7ffea authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

it is possible to create `CodedCustomException` without an argument

parent a8c30a08
No related branches found
Tags v2.14.31
No related merge requests found
......@@ -3,3 +3,5 @@
* added `sleep_interval` to `hang_until_sig`
* added `read_lines`
* changed `ImpossibleError` to be a `BaseException`
* it is possible to create `CodedCustomException` without an argument
__version__ = '2.14.31a5'
__version__ = '2.14.31'
......@@ -123,7 +123,7 @@ class CodedCustomException(CustomException, metaclass=CodedCustomExceptionMetacl
>>> assert not isinstance(a, MyCode5Diff)
"""
def __init__(self, message, code=None, *args, **kwargs):
def __init__(self, message='', code=None, *args, **kwargs):
super().__init__(message, code, *args, **kwargs)
self.message = message # type: str
if code is not None:
......
......@@ -2,10 +2,12 @@ import unittest
from satella.exceptions import BaseSatellaError, CustomException, CodedCustomException, \
ImpossibleError
ImpossibleError, CodedCustomException
class TestExceptions(unittest.TestCase):
def test_coded_custom_exception_no_args(self):
CodedCustomException()
def test_impossible_error(self):
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment