Skip to content

Commit 65aee1e

Browse files
committed
Allow bytes for OutcomeException(msg=...)
It's __repr__ explicitly handles it so allow it.
1 parent 8d413c1 commit 65aee1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/_pytest/outcomes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
from typing import Any
77
from typing import Optional
8+
from typing import Union
89

910
from packaging.version import Version
1011

@@ -17,7 +18,9 @@ class OutcomeException(BaseException):
1718
contain info about test and collection outcomes.
1819
"""
1920

20-
def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None:
21+
def __init__(
22+
self, msg: Optional[Union[str, bytes]] = None, pytrace: bool = True
23+
) -> None:
2124
BaseException.__init__(self, msg)
2225
self.msg = msg
2326
self.pytrace = pytrace

0 commit comments

Comments
 (0)