X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Fconftest.py;h=598fc01c95afd567bcb1f05c093d73677161c353;hb=5cb6317e84178beb054230ae88d3af1a882920cf;hp=09baa9abd2b9353ca41716680480105fbafd605f;hpb=f5edc06be0d8bedeb0904b348ba5e3e67c74f186;p=vvp%2Fvalidation-scripts.git 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")