diff options
author | Daniel Hahler <git@thequod.de> | 2019-08-02 16:20:21 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-08-02 16:52:51 +0200 |
commit | b5b710b3ae26c6fcc257ace8db94c0ca54340c4e (patch) | |
tree | b55991e233614d50f2af661e18a9faf9f165a22b /src/_pytest/outcomes.py | |
parent | 4abf95ba4fe566ef6deb8ef49e3e82cc22fa9252 (diff) | |
parent | 0d3958e8dec5f78ed19ba5bc7a00a35f3ea3deb0 (diff) | |
download | pytest-b5b710b3ae26c6fcc257ace8db94c0ca54340c4e.tar.gz |
Merge master into features
Several conflicts, mostly due to 2c402f4bd.
Conflicts:
.pre-commit-config.yaml
src/_pytest/outcomes.py
src/_pytest/python_api.py
tox.ini
Diffstat (limited to 'src/_pytest/outcomes.py')
-rw-r--r-- | src/_pytest/outcomes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index a5a4e655b..5e331a323 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -18,6 +18,12 @@ class OutcomeException(BaseException): """ def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None: + if msg is not None and not isinstance(msg, str): + error_msg = ( + "{} expected string as 'msg' parameter, got '{}' instead.\n" + "Perhaps you meant to use a mark?" + ) + raise TypeError(error_msg.format(type(self).__name__, type(msg).__name__)) BaseException.__init__(self, msg) self.msg = msg self.pytrace = pytrace |