aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstark, steven <ss820f@att.com>2018-08-30 14:22:33 -0700
committerstark, steven <ss820f@att.com>2018-08-30 14:45:03 -0700
commit5cb6317e84178beb054230ae88d3af1a882920cf (patch)
tree8807bdfa4dc8655526a659913715fa66f696093a
parent01741ac3f2d3143699bbb86f8aa2af4d8a3f43e0 (diff)
[VVP] pytest --self-test xfail
validation scripts pytest --self-test "xfail" being skipped Issue-ID: VVP-108 Change-Id: I1bdb146db3de78b393315499491b3ad65597213c Signed-off-by: stark, steven <ss820f@att.com>
-rw-r--r--ice_validator/tests/conftest.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py
index 09baa9a..598fc01 100644
--- a/ice_validator/tests/conftest.py
+++ b/ice_validator/tests/conftest.py
@@ -70,7 +70,11 @@ report = collections.OrderedDict(report_columns)
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:
@@ -142,9 +146,9 @@ def pytest_sessionfinish(session, exitstatus):
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")