diff options
author | Ran Benita <ran@unusedvar.com> | 2020-05-01 14:40:17 +0300 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-06-05 11:34:20 +0300 |
commit | 2b05faff0a0172dbc74b81f47528e56ad608839e (patch) | |
tree | 9dd289ab7c1fc9ba2b361ce6528ba053bf8c0a95 /src/_pytest/skipping.py | |
parent | 54ad048be7182018e70479bd3d9b88bcb6376c00 (diff) | |
download | pytest-2b05faff0a0172dbc74b81f47528e56ad608839e.tar.gz |
Improve types around repr_failure()
Diffstat (limited to 'src/_pytest/skipping.py')
-rw-r--r-- | src/_pytest/skipping.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index 54621f111..bbd4593fd 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -148,7 +148,8 @@ def pytest_runtest_makereport(item: Item, call: CallInfo[None]): elif item.config.option.runxfail: pass # don't interfere - elif call.excinfo and call.excinfo.errisinstance(xfail.Exception): + elif call.excinfo and isinstance(call.excinfo.value, xfail.Exception): + assert call.excinfo.value.msg is not None rep.wasxfail = "reason: " + call.excinfo.value.msg rep.outcome = "skipped" elif evalxfail and not rep.skipped and evalxfail.wasvalid() and evalxfail.istrue(): |