[py] Correct skipping based on markers
@@ -85,6 +85,15 @@ def driver(request):
marker = request.node.get_closest_marker('xfail_{0}'.format(driver_class.lower()))
if marker is not None:
+ if "run" in marker.kwargs:
+ if marker.kwargs["run"] is False:
+ pytest.skip()
+ yield
+ return
+ if "raises" in marker.kwargs:
+ marker.kwargs.pop("raises")
+ pytest.xfail(**marker.kwargs)
+
def fin():
global driver_instance
if driver_instance is not None:
@@ -92,13 +101,6 @@ def driver(request):
driver_instance = None
request.addfinalizer(fin)
- # skip driver instantiation if xfail(run=False)
- # if not request.config.getoption('runxfail'):
- # if request.node._evalxfail.istrue():
- # if request.node._evalxfail.get('run') is False:
- # yield
- # return
-
driver_path = request.config.option.executable
options = None
