Allow bytes for OutcomeException(msg=...)

It's __repr__ explicitly handles it so allow it.
This commit is contained in:
Ran Benita 2019-07-14 18:27:09 +03:00
parent 8d413c1926
commit 65aee1e0c8
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ as well as functions creating them
import sys
from typing import Any
from typing import Optional
from typing import Union
from packaging.version import Version
@ -17,7 +18,9 @@ class OutcomeException(BaseException):
contain info about test and collection outcomes.
"""
def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None:
def __init__(
self, msg: Optional[Union[str, bytes]] = None, pytrace: bool = True
) -> None:
BaseException.__init__(self, msg)
self.msg = msg
self.pytrace = pytrace