[py] Skip tests if we can't run them on that platform
# under the License.
import os
+import platform
import socket
import subprocess
import sys
@@ -81,6 +82,15 @@ def driver(request):
except AttributeError:
raise Exception('This test requires a --driver to be specified.')
+ # skip tests if not available on the platform
+ _platform = platform.system()
+ if driver_class == "Safari" and _platform != "Darwin":
+ pytest.skip("Safari tests can only run on an Apple OS")
+ if (driver_class == "Ie" or driver_class == "Edge") and _platform != "Windows":
+ pytest.skip("IE and EdgeHTML Tests can only run on Windows")
+ if "WebKit" in driver_class and _platform != "Linux":
+ pytest.skip("Webkit tests can only run on Linux")
+
# conditionally mark tests as expected to fail based on driver
marker = request.node.get_closest_marker('xfail_{0}'.format(driver_class.lower()))
