def extract_error_msg(rep):
- msg = str(rep.longrepr.reprcrash)
+ try:
+ msg = str(rep.longrepr.reprcrash)
+ except AttributeError:
+ msg = str(rep)
+
if "AssertionError:" in msg:
return msg.split("AssertionError:")[1]
else:
def pytest_runtest_setup(item):
profile = item.session.config.option.validation_profile
markers = set(m.name for m in item.iter_markers())
- if not profile and markers:
+ if not profile and markers and "xfail" not in markers:
pytest.skip("No validation profile selected. Skipping tests with marks.")
- if profile and markers and profile not in markers:
+ if profile and markers and profile not in markers and "xfail" not in markers:
pytest.skip("Doesn't match selection validation profile")