diff --git a/WebDriverTests/ChangeLog b/WebDriverTests/ChangeLog index 9ade8c2f5c27..ca80d824a32b 100644 --- a/WebDriverTests/ChangeLog +++ b/WebDriverTests/ChangeLog @@ -1,3 +1,50 @@ +2018-01-22 Carlos Garcia Campos + + Unreviewed. Update W3C WebDriver imported tests. + + * imported/w3c/importer.json: + * imported/w3c/tools/webdriver/webdriver/client.py: + * imported/w3c/tools/webdriver/webdriver/protocol.py: + * imported/w3c/tools/webdriver/webdriver/servo.py: Removed. + * imported/w3c/tools/webdriver/webdriver/transport.py: + * imported/w3c/tools/wptrunner/MANIFEST.in: + * imported/w3c/tools/wptrunner/README.rst: + * imported/w3c/tools/wptrunner/docs/conf.py: + * imported/w3c/tools/wptrunner/docs/usage.rst: + * imported/w3c/tools/wptrunner/setup.py: + * imported/w3c/tools/wptrunner/tox.ini: + * imported/w3c/tools/wptrunner/wptrunner/browsers/__init__.py: + * imported/w3c/tools/wptrunner/wptrunner/browsers/b2g_setup/certtest_app.zip: Removed. + * imported/w3c/tools/wptrunner/wptrunner/browsers/chrome_android.py: Copied from WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py. + * imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py: + * imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py: + * imported/w3c/tools/wptrunner/wptrunner/browsers/servo.py: + * imported/w3c/tools/wptrunner/wptrunner/environment.py: + * imported/w3c/tools/wptrunner/wptrunner/executors/base.py: + * imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py: + * imported/w3c/tools/wptrunner/wptrunner/executors/executorselenium.py: + * imported/w3c/tools/wptrunner/wptrunner/executors/executorservo.py: + * imported/w3c/tools/wptrunner/wptrunner/executors/executorservodriver.py: + * imported/w3c/tools/wptrunner/wptrunner/manifestupdate.py: + * imported/w3c/tools/wptrunner/wptrunner/metadata.py: + * imported/w3c/tools/wptrunner/wptrunner/stability.py: + * imported/w3c/tools/wptrunner/wptrunner/testloader.py: + * imported/w3c/tools/wptrunner/wptrunner/testrunner.py: + * imported/w3c/tools/wptrunner/wptrunner/tests/test_hosts.py: + * imported/w3c/tools/wptrunner/wptrunner/update/__init__.py: + * imported/w3c/tools/wptrunner/wptrunner/update/sync.py: + * imported/w3c/tools/wptrunner/wptrunner/update/tree.py: + * imported/w3c/tools/wptrunner/wptrunner/vcs.py: + * imported/w3c/tools/wptrunner/wptrunner/webdriver_server.py: + * imported/w3c/tools/wptrunner/wptrunner/wptcommandline.py: + * imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py: + * imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_tokenizer.py: + * imported/w3c/tools/wptrunner/wptrunner/wptrunner.py: + * imported/w3c/tools/wptrunner/wptrunner/wpttest.py: + * imported/w3c/webdriver/tests/execute_async_script/__init__.py: Added. + * imported/w3c/webdriver/tests/execute_script/__init__.py: Added. + * imported/w3c/webdriver/tests/sessions/new_session/response.py: + 2018-01-22 Carlos Garcia Campos [GTK] WebDriver: test imported/w3c/webdriver/tests/sessions/new_session/response.py is crashing in the bots diff --git a/WebDriverTests/imported/w3c/importer.json b/WebDriverTests/imported/w3c/importer.json index 46e3c0984ea3..bcd7eb563aec 100644 --- a/WebDriverTests/imported/w3c/importer.json +++ b/WebDriverTests/imported/w3c/importer.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/w3c/web-platform-tests.git", - "revision": "d44e0531e8ca9b0e44a794a013b5cc42f22f5528", + "revision": "a9c9f5fd5e6567d42cc85cf8b8571e3d69785b9b", "paths_to_import": [ "tools/webdriver", "tools/wptrunner", diff --git a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/client.py b/WebDriverTests/imported/w3c/tools/webdriver/webdriver/client.py index ec7d6deccbac..622c5fce76ac 100644 --- a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/client.py +++ b/WebDriverTests/imported/w3c/tools/webdriver/webdriver/client.py @@ -4,6 +4,8 @@ import protocol import transport +from six import string_types + from mozlog import get_default_logger logger = get_default_logger() @@ -313,7 +315,7 @@ def __setitem__(self, name, value): cookie = {"name": name, "value": None} - if isinstance(name, (str, unicode)): + if isinstance(name, string_types): cookie["value"] = value elif hasattr(value, "value"): cookie["value"] = value.value diff --git a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/protocol.py b/WebDriverTests/imported/w3c/tools/webdriver/webdriver/protocol.py index 80f358c8b0ad..ea0c793accbd 100644 --- a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/protocol.py +++ b/WebDriverTests/imported/w3c/tools/webdriver/webdriver/protocol.py @@ -16,7 +16,7 @@ def default(self, obj): return [self.default(x) for x in obj] elif isinstance(obj, webdriver.Element): return {webdriver.Element.identifier: obj.id} - return super(ProtocolEncoder, self).default(obj) + return super(Encoder, self).default(obj) class Decoder(json.JSONDecoder): diff --git a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/servo.py b/WebDriverTests/imported/w3c/tools/webdriver/webdriver/servo.py deleted file mode 100644 index 2e0b722ababe..000000000000 --- a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/servo.py +++ /dev/null @@ -1,18 +0,0 @@ -class ServoExtensionCommands(object): - def __init__(self, session): - self.session = session - - @command - def get_prefs(self, *prefs): - body = {"prefs": list(prefs)} - return self.session.send_command("POST", "servo/prefs/get", body) - - @command - def set_prefs(self, prefs): - body = {"prefs": prefs} - return self.session.send_command("POST", "servo/prefs/set", body) - - @command - def reset_prefs(self, *prefs): - body = {"prefs": list(prefs)} - return self.session.send_command("POST", "servo/prefs/reset", body) diff --git a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/transport.py b/WebDriverTests/imported/w3c/tools/webdriver/webdriver/transport.py index b198b194b38b..d62271fe957c 100644 --- a/WebDriverTests/imported/w3c/tools/webdriver/webdriver/transport.py +++ b/WebDriverTests/imported/w3c/tools/webdriver/webdriver/transport.py @@ -4,6 +4,7 @@ import error +from six import text_type """Implements HTTP transport for the WebDriver wire protocol.""" @@ -135,7 +136,7 @@ def send(self, except ValueError: raise ValueError("Failed to encode request body as JSON:\n" "%s" % json.dumps(body, indent=2)) - if isinstance(payload, unicode): + if isinstance(payload, text_type): payload = body.encode("utf-8") if headers is None: diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/MANIFEST.in b/WebDriverTests/imported/w3c/tools/wptrunner/MANIFEST.in index 2be4d915be1a..708392378899 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/MANIFEST.in +++ b/WebDriverTests/imported/w3c/tools/wptrunner/MANIFEST.in @@ -1,6 +1,5 @@ exclude MANIFEST.in include requirements.txt -include wptrunner/browsers/b2g_setup/* include wptrunner.default.ini include wptrunner/testharness_runner.html include wptrunner/*.js diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/README.rst b/WebDriverTests/imported/w3c/tools/wptrunner/README.rst index 780518aae114..834e07ee41d1 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/README.rst +++ b/WebDriverTests/imported/w3c/tools/wptrunner/README.rst @@ -23,7 +23,7 @@ The ``wptrunner`` command takes multiple options, of which the following are most significant: ``--product`` (defaults to `firefox`) - The product to test against: `b2g`, `chrome`, `firefox`, or `servo`. + The product to test against: `chrome`, `firefox`, or `servo`. ``--binary`` (required if product is `firefox` or `servo`) The path to a binary file for the product (browser) to test against. diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/docs/conf.py b/WebDriverTests/imported/w3c/tools/wptrunner/docs/conf.py index 0c717f56536b..b58f313e946a 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/docs/conf.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/docs/conf.py @@ -186,22 +186,22 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'wptrunner.tex', u'wptrunner Documentation', - u'James Graham', 'manual'), + ('index', 'wptrunner.tex', u'wptrunner Documentation', + u'James Graham', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -244,9 +244,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'wptrunner', u'wptrunner Documentation', - u'James Graham', 'wptrunner', 'One line description of project.', - 'Miscellaneous'), + ('index', 'wptrunner', u'wptrunner Documentation', + u'James Graham', 'wptrunner', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/docs/usage.rst b/WebDriverTests/imported/w3c/tools/wptrunner/docs/usage.rst index 8e74a4320c82..258cca6eca9e 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/docs/usage.rst +++ b/WebDriverTests/imported/w3c/tools/wptrunner/docs/usage.rst @@ -54,7 +54,7 @@ A test run is started using the ``wptrunner`` command. The command takes multiple options, of which the following are most significant: ``--product`` (defaults to `firefox`) - The product to test against: `b2g`, `chrome`, `firefox`, or `servo`. + The product to test against: `chrome`, `firefox`, or `servo`. ``--binary`` (required if product is `firefox` or `servo`) The path to a binary file for the product (browser) to test against. diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/setup.py b/WebDriverTests/imported/w3c/tools/wptrunner/setup.py index 7ec189fefd9a..7da514183271 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/setup.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/setup.py @@ -53,13 +53,12 @@ "config.json", "wptrunner.default.ini", "browsers/server-locations.txt", - "browsers/b2g_setup/*", "browsers/sauce_setup/*", "prefs/*"]}, include_package_data=True, data_files=[("requirements", requirements_files)], install_requires=deps - ) + ) if "install" in sys.argv: path = os.path.relpath(os.path.join(sys.prefix, "requirements"), os.curdir) diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/tox.ini b/WebDriverTests/imported/w3c/tools/wptrunner/tox.ini index 790970409f36..fa6aa3f71296 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/tox.ini +++ b/WebDriverTests/imported/w3c/tools/wptrunner/tox.ini @@ -2,7 +2,7 @@ xfail_strict=true [tox] -envlist = {py27,pypy}-{base,b2g,chrome,firefox,servo} +envlist = {py27,pypy}-{base,chrome,firefox,servo},py27-flake8 [testenv] deps = @@ -15,3 +15,40 @@ deps = servo: -r{toxinidir}/requirements_servo.txt commands = pytest --cov + +[testenv:py27-flake8] +# flake8 versions should be kept in sync across tools/tox.ini, tools/wpt/tox.ini, and tools/wptrunner/tox.ini +deps = + flake8==3.5.0 + pycodestyle==2.3.1 + pyflakes==1.6.0 + pep8-naming==0.4.1 + +commands = + flake8 + +[flake8] +# flake8 config should be kept in sync across tools/tox.ini, tools/wpt/tox.ini, and tools/wptrunner/tox.ini +select = E,W,F,N +# E128: continuation line under-indented for visual indent +# E129: visually indented line with same indent as next logical line +# E221: multiple spaces before operator +# E226: missing whitespace around arithmetic operator +# E231: missing whitespace after ‘,’, ‘;’, or ‘:’ +# E251: unexpected spaces around keyword / parameter equals +# E265: block comment should start with ‘# ‘ +# E302: expected 2 blank lines, found 0 +# E303: too many blank lines (3) +# E305: expected 2 blank lines after end of function or class +# E402: module level import not at top of file +# E731: do not assign a lambda expression, use a def +# E901: SyntaxError or IndentationError +# W601: .has_key() is deprecated, use ‘in’ +# F401: module imported but unused +# F403: ‘from module import *’ used; unable to detect undefined names +# F405: name may be undefined, or defined from star imports: module +# F841: local variable name is assigned to but never used +# N801: class names should use CapWords convention +# N802: function name should be lowercase +ignore = E128,E129,E221,E226,E231,E251,E265,E302,E303,E305,E402,E731,E901,W601,F401,F403,F405,F841,N801,N802 +max-line-length = 141 diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/__init__.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/__init__.py index a5c253357423..1e74863b733d 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/__init__.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/__init__.py @@ -23,6 +23,7 @@ """ product_list = ["chrome", + "chrome_android", "edge", "firefox", "ie", diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/b2g_setup/certtest_app.zip b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/b2g_setup/certtest_app.zip deleted file mode 100644 index f9cbd5300ad6..000000000000 Binary files a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/b2g_setup/certtest_app.zip and /dev/null differ diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/chrome_android.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/chrome_android.py new file mode 100644 index 000000000000..9e53bc660e28 --- /dev/null +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/chrome_android.py @@ -0,0 +1,98 @@ +from .base import Browser, ExecutorBrowser, require_arg +from ..webdriver_server import ChromeDriverServer +from ..executors import executor_kwargs as base_executor_kwargs +from ..executors.executorselenium import (SeleniumTestharnessExecutor, + SeleniumRefTestExecutor) +from ..executors.executorchrome import ChromeDriverWdspecExecutor + + +__wptrunner__ = {"product": "chrome_android", + "check_args": "check_args", + "browser": "ChromeAndroidBrowser", + "executor": {"testharness": "SeleniumTestharnessExecutor", + "reftest": "SeleniumRefTestExecutor", + "wdspec": "ChromeDriverWdspecExecutor"}, + "browser_kwargs": "browser_kwargs", + "executor_kwargs": "executor_kwargs", + "env_extras": "env_extras", + "env_options": "env_options"} + + +def check_args(**kwargs): + require_arg(kwargs, "webdriver_binary") + + +def browser_kwargs(test_type, run_info_data, **kwargs): + return {"binary": kwargs["binary"], + "webdriver_binary": kwargs["webdriver_binary"], + "webdriver_args": kwargs.get("webdriver_args")} + + +def executor_kwargs(test_type, server_config, cache_manager, run_info_data, + **kwargs): + from selenium.webdriver import DesiredCapabilities + + executor_kwargs = base_executor_kwargs(test_type, server_config, + cache_manager, **kwargs) + executor_kwargs["close_after_done"] = True + capabilities = dict(DesiredCapabilities.CHROME.items()) + capabilities["chromeOptions"] = {} + # required to start on mobile + capabilities["chromeOptions"]["androidPackage"] = "com.android.chrome" + + for (kwarg, capability) in [("binary", "binary"), ("binary_args", "args")]: + if kwargs[kwarg] is not None: + capabilities["chromeOptions"][capability] = kwargs[kwarg] + if test_type == "testharness": + capabilities["useAutomationExtension"] = False + capabilities["excludeSwitches"] = ["enable-automation"] + if test_type == "wdspec": + capabilities["chromeOptions"]["w3c"] = True + executor_kwargs["capabilities"] = capabilities + return executor_kwargs + + +def env_extras(**kwargs): + return [] + + +def env_options(): + return {"host": "web-platform.test", + "bind_hostname": "true"} + + +class ChromeAndroidBrowser(Browser): + """Chrome is backed by chromedriver, which is supplied through + ``wptrunner.webdriver.ChromeDriverServer``. + """ + + def __init__(self, logger, binary, webdriver_binary="chromedriver", + webdriver_args=None): + """Creates a new representation of Chrome. The `binary` argument gives + the browser binary to use for testing.""" + Browser.__init__(self, logger) + self.binary = binary + self.server = ChromeDriverServer(self.logger, + binary=webdriver_binary, + args=webdriver_args) + + def start(self, **kwargs): + self.server.start(block=False) + + def stop(self, force=False): + self.server.stop(force=force) + + def pid(self): + return self.server.pid + + def is_alive(self): + # TODO(ato): This only indicates the driver is alive, + # and doesn't say anything about whether a browser session + # is active. + return self.server.is_alive() + + def cleanup(self): + self.stop() + + def executor_browser(self): + return ExecutorBrowser, {"webdriver_url": self.server.url} diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py index b324bccd91e2..6d1f58d37916 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py @@ -96,15 +96,15 @@ def executor_kwargs(test_type, server_config, cache_manager, run_info_data, executor_kwargs["reftest_internal"] = kwargs["reftest_internal"] executor_kwargs["reftest_screenshot"] = kwargs["reftest_screenshot"] if test_type == "wdspec": - fxOptions = {} + options = {} if kwargs["binary"]: - fxOptions["binary"] = kwargs["binary"] + options["binary"] = kwargs["binary"] if kwargs["binary_args"]: - fxOptions["args"] = kwargs["binary_args"] - fxOptions["prefs"] = { + options["args"] = kwargs["binary_args"] + options["prefs"] = { "network.dns.localDomains": ",".join(hostnames) } - capabilities["moz:firefoxOptions"] = fxOptions + capabilities["moz:firefoxOptions"] = options if kwargs["certutil_binary"] is None: capabilities["acceptInsecureCerts"] = True if capabilities: @@ -364,7 +364,7 @@ def setup_ssl(self): env[env_var] = (os.path.pathsep.join([certutil_dir, env[env_var]]) if env_var in env else certutil_dir).encode( - sys.getfilesystemencoding() or 'utf-8', 'replace') + sys.getfilesystemencoding() or 'utf-8', 'replace') def certutil(*args): cmd = [self.certutil_binary] + list(args) diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py index 553372f390e7..13f5827194de 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py @@ -28,10 +28,10 @@ def executor_kwargs(test_type, server_config, cache_manager, run_info_data, **kwargs): from selenium.webdriver import DesiredCapabilities - ieOptions = {} - ieOptions["requireWindowFocus"] = True + options = {} + options["requireWindowFocus"] = True capabilities = {} - capabilities["se:ieOptions"] = ieOptions + capabilities["se:ieOptions"] = options executor_kwargs = base_executor_kwargs(test_type, server_config, cache_manager, **kwargs) executor_kwargs["close_after_done"] = True @@ -51,7 +51,7 @@ class InternetExplorerBrowser(Browser): def __init__(self, logger, webdriver_binary, webdriver_args=None): Browser.__init__(self, logger) - self.server = InterentExplorerDriverServer(self.logger, + self.server = InternetExplorerDriverServer(self.logger, binary=webdriver_binary, args=webdriver_args) self.webdriver_host = "localhost" diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/servo.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/servo.py index 3738ce4bddcd..17fa59834fd7 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/servo.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/browsers/servo.py @@ -54,7 +54,7 @@ def env_extras(**kwargs): def env_options(): return {"host": "127.0.0.1", "external_host": "web-platform.test", - "bind_hostname": "true", + "bind_hostname": "false", "testharnessreport": "testharnessreport-servo.js", "supports_debugger": True} diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/environment.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/environment.py index 874595cbff3f..711534180dc6 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/environment.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/environment.py @@ -61,7 +61,7 @@ def get_ssl_kwargs(**kwargs): elif kwargs["ssl_type"] == "pregenerated": args = {"host_key_path": kwargs["host_key_path"], "host_cert_path": kwargs["host_cert_path"], - "ca_cert_path": kwargs["ca_cert_path"]} + "ca_cert_path": kwargs["ca_cert_path"]} else: args = {} return args diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/base.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/base.py index d87e4ab9924f..7178b2e28c37 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/base.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/base.py @@ -13,7 +13,7 @@ # Extra timeout to use after internal test timeout at which the harness # should force a timeout -extra_timeout = 5 # seconds +extra_timeout = 5 # seconds def executor_kwargs(test_type, server_config, cache_manager, **kwargs): @@ -67,8 +67,8 @@ def __call__(self, test, result): (result_url, test.url)) harness_result = test.result_cls(self.harness_codes[status], message) return (harness_result, - [test.subtest_result_cls(name, self.test_codes[status], message, stack) - for name, status, message, stack in subtest_results]) + [test.subtest_result_cls(st_name, self.test_codes[st_status], st_message, st_stack) + for st_name, st_status, st_message, st_stack in subtest_results]) testharness_result_converter = TestharnessResultConverter() @@ -124,7 +124,7 @@ def __init__(self, browser, server_config, timeout_multiplier=1, self.debug_info = debug_info self.last_environment = {"protocol": "http", "prefs": {}} - self.protocol = None # This must be set in subclasses + self.protocol = None # This must be set in subclasses @property def logger(self): diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py index 2d0dc914d105..30930c3c2f92 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py @@ -304,7 +304,7 @@ def __init__(self, logger, func, protocol, url, timeout): self.result_flag = threading.Event() def run(self): - index = self.url.rfind("/storage/"); + index = self.url.rfind("/storage/") if index != -1: # Clear storage self.protocol.clear_origin(self.url) @@ -503,7 +503,7 @@ def screenshot(self, test, viewport_size, dpi): assert viewport_size is None assert dpi is None - timeout = self.timeout_multiplier * test.timeout if self.debug_info is None else None + timeout = self.timeout_multiplier * test.timeout if self.debug_info is None else None test_url = self.test_url(test) diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorselenium.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorselenium.py index 2e84ab6fd65d..f905fac81e10 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorselenium.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorselenium.py @@ -51,7 +51,7 @@ def setup(self, runner): self.webdriver = webdriver.Remote(command_executor=RemoteConnection(self.url.strip("/"), resolve_ip=False), desired_capabilities=self.capabilities) - except: + except Exception: self.logger.warning( "Connecting to Selenium failed:\n%s" % traceback.format_exc()) else: @@ -64,7 +64,7 @@ def setup(self, runner): else: try: self.after_connect() - except: + except Exception: print >> sys.stderr, traceback.format_exc() self.logger.warning( "Failed to connect to navigate initial page") @@ -76,7 +76,7 @@ def teardown(self): self.logger.debug("Hanging up on Selenium session") try: self.webdriver.quit() - except: + except Exception: pass del self.webdriver @@ -103,7 +103,7 @@ def load_runner(self, protocol): def wait(self): while True: try: - self.webdriver.execute_async_script(""); + self.webdriver.execute_async_script("") except exceptions.TimeoutException: pass except (socket.timeout, exceptions.NoSuchWindowException, @@ -220,7 +220,7 @@ def do_testharness(self, webdriver, url, timeout): win_s = webdriver.execute_script("return window['%s'];" % self.window_id) win_obj = json.loads(win_s) test_window = win_obj["window-fcc6-11e5-b4f8-330a88ab9d7f"] - except: + except Exception: after = webdriver.window_handles if len(after) == 2: test_window = next(iter(set(after) - set([parent]))) diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservo.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservo.py index 33ff10df9287..ca8ec8a7eb5a 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservo.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservo.py @@ -28,7 +28,7 @@ pytestrunner = None webdriver = None -extra_timeout = 5 # seconds +extra_timeout = 5 # seconds hosts_text = """127.0.0.1 web-platform.test 127.0.0.1 www.web-platform.test diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservodriver.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservodriver.py index af09da6f1788..ed7afaf1028b 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservodriver.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/executors/executorservodriver.py @@ -43,7 +43,7 @@ def setup(self, runner): self.session = webdriver.Session(self.host, self.port, extension=webdriver.servo.ServoCommandExtensions) self.session.start() - except: + except Exception: self.logger.warning( "Connecting with WebDriver failed:\n%s" % traceback.format_exc()) else: @@ -60,7 +60,7 @@ def teardown(self): self.logger.debug("Hanging up on WebDriver session") try: self.session.end() - except: + except Exception: pass def is_alive(self): diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/manifestupdate.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/manifestupdate.py index fd3f82aeb113..1d3c173928f0 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/manifestupdate.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/manifestupdate.py @@ -247,8 +247,8 @@ def coalesce_expected(self, stability=None): boolean_properties=self.root.boolean_properties) except ConditionError as e: if stability is not None: - self.set("disabled", stability or "unstable", e.cond.children[0]) - self.new_disabled = True + self.set("disabled", stability or "unstable", e.cond.children[0]) + self.new_disabled = True else: print "Conflicting test results for %s, cannot update" % self.root.test_path return diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/metadata.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/metadata.py index 923ac7907335..9c31e4279ef6 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/metadata.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/metadata.py @@ -355,7 +355,7 @@ def load_expected(test_manifest, metadata_path, test_path, tests, property_order # Remove expected data for tests that no longer exist for test in expected_manifest.iterchildren(): - if not test.id in tests_by_id: + if test.id not in tests_by_id: test.remove() # Add tests that don't have expected data diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/stability.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/stability.py index 6eb060485c2c..e1709c5749a4 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/stability.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/stability.py @@ -274,6 +274,6 @@ def check_stability(logger, repeat_loop=10, repeat_restart=5, chaos_mode=True, m write_summary(logger, step_results, "FAIL") return 1 - step_results.append((desc, "PASS")) + step_results.append((desc, "PASS")) write_summary(logger, step_results, "PASS") diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testloader.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testloader.py index 0eb78bb884f6..199ed6c26668 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testloader.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testloader.py @@ -93,7 +93,7 @@ def __init__(self, path): for i, (test_type, test_path, tests) in enumerate(manifest_items): test_dir = tuple(os.path.split(test_path)[0].split(os.path.sep)[:3]) - if not test_dir in by_dir: + if test_dir not in by_dir: by_dir[test_dir] = PathData(test_dir) data = by_dir[test_dir] @@ -261,7 +261,7 @@ def popleft(self): return self.paths.popleft() @property - def badness(self_): + def badness(self_): # noqa: N805 """Badness metric for this chunk""" return self._badness(self_.time) @@ -587,6 +587,7 @@ def __init__(self, test_queue): self.current_metadata = None @abstractmethod + # noqa: N805 #@classmethod (doesn't compose with @abstractmethod) def make_queue(cls, tests, **kwargs): pass diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testrunner.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testrunner.py index 75f4825f9525..85ffbe3741ab 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testrunner.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/testrunner.py @@ -195,7 +195,7 @@ def init(self): self.logger.debug("Starting browser with settings %r" % self.browser_settings) self.browser.start(**self.browser_settings) self.browser_pid = self.browser.pid() - except: + except Exception: self.logger.warning("Failure during init %s" % traceback.format_exc()) if self.init_timer is not None: self.init_timer.cancel() @@ -566,7 +566,7 @@ def test_ended(self, test, results): expected = test.expected() status = file_result.status if file_result.status != "EXTERNAL-TIMEOUT" else "TIMEOUT" - if file_result.status in ("TIMEOUT", "EXTERNAL-TIMEOUT"): + if file_result.status in ("TIMEOUT", "EXTERNAL-TIMEOUT"): if self.browser.check_for_crashes(): status = "CRASH" @@ -585,8 +585,8 @@ def test_ended(self, test, results): restart_before_next = (test.restart_after or file_result.status in ("CRASH", "EXTERNAL-TIMEOUT") or - ((subtest_unexpected or is_unexpected) - and self.restart_on_unexpected)) + ((subtest_unexpected or is_unexpected) and + self.restart_on_unexpected)) if (self.pause_after_test or (self.pause_on_unexpected and (subtest_unexpected or is_unexpected))): @@ -689,7 +689,7 @@ def cleanup(self): break else: if cmd == "log": - self.log(*data) + self.log(*data) else: self.logger.warning("%r: %r" % (cmd, data)) while True: diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/tests/test_hosts.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/tests/test_hosts.py index 808b81606aeb..e7d41f3b4208 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/tests/test_hosts.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/tests/test_hosts.py @@ -42,15 +42,13 @@ def test_alignment(self): 192.168.1.1 another_host another_alias ""","""127.0.0.1 localhost alias 192.168.1.1 another_host another_alias -""" -) +""") def test_multiple_same_name(self): # The semantics are that we overwrite earlier entries with the same name self.do_test("""127.0.0.1 \tlocalhost alias 192.168.1.1 localhost another_alias""","""192.168.1.1 localhost another_alias -""" -) +""") if __name__ == "__main__": unittest.main() diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/__init__.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/__init__.py index 497cb34ad0cb..99dac6bcccca 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/__init__.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/__init__.py @@ -44,4 +44,3 @@ def main(): assert structuredlog.get_default_logger() is not None success = run_update(logger, **args) sys.exit(0 if success else 1) - diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/sync.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/sync.py index c1bff8543498..f2660e5a33ec 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/sync.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/sync.py @@ -109,7 +109,7 @@ def create(self, state): state.sync["branch"], state.local_branch) sync_path = os.path.abspath(sync_tree.root) - if not sync_path in sys.path: + if sync_path not in sys.path: from update import setup_paths setup_paths(sync_path) diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/tree.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/tree.py index 01df0b4f94a3..279ddba1f6f3 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/tree.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/update/tree.py @@ -75,7 +75,7 @@ def is_type(cls, path=None): kwargs["repo"] = path try: hg("root", **kwargs) - except: + except Exception: return False return True @@ -155,7 +155,7 @@ def is_type(cls, path=None): kwargs["repo"] = path try: git("rev-parse", "--show-toplevel", **kwargs) - except: + except Exception: return False return True @@ -305,8 +305,8 @@ def clean(self): def paths(self): """List paths in the tree""" - repo_paths = [self.root] + [os.path.join(self.root, path) - for path in self.submodules()] + repo_paths = [self.root] + [os.path.join(self.root, path) + for path in self.submodules()] rv = [] diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/vcs.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/vcs.py index 16d53afc8be6..a51312d3937a 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/vcs.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/vcs.py @@ -15,7 +15,7 @@ def inner(command, *args, **kwargs): repo = kwargs.pop("repo", None) log_error = kwargs.pop("log_error", True) if kwargs: - raise TypeError, kwargs + raise TypeError(kwargs) args = list(args) diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/webdriver_server.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/webdriver_server.py index fc853bfb97e6..7b78898344fd 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/webdriver_server.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/webdriver_server.py @@ -72,7 +72,7 @@ def _run(self, block): "Waiting for server to become accessible: %s" % self.url) try: wait_for_service((self.host, self.port)) - except: + except Exception: self.logger.error( "WebDriver HTTP server was not accessible " "within the timeout:\n%s" % traceback.format_exc()) @@ -125,8 +125,6 @@ def make_command(self): class ChromeDriverServer(WebDriverServer): - default_base_path = "/" - def __init__(self, logger, binary="chromedriver", port=None, base_path="", args=None): WebDriverServer.__init__( @@ -138,8 +136,6 @@ def make_command(self): cmd_arg("url-base", self.base_path) if self.base_path else ""] + self._args class EdgeDriverServer(WebDriverServer): - default_base_path = "/" - def __init__(self, logger, binary="microsoftwebdriver.exe", port=None, base_path="", args=None): WebDriverServer.__init__( @@ -147,8 +143,7 @@ def __init__(self, logger, binary="microsoftwebdriver.exe", port=None, def make_command(self): return [self.binary, - cmd_arg("port", str(self.port)), - cmd_arg("url-base", self.base_path) if self.base_path else ""] + self._args + "--port=%s" % str(self.port)] + self._args class OperaDriverServer(ChromeDriverServer): def __init__(self, logger, binary="operadriver", port=None, @@ -157,17 +152,6 @@ def __init__(self, logger, binary="operadriver", port=None, self, logger, binary, port=port, base_path=base_path, args=args) -class EdgeDriverServer(WebDriverServer): - def __init__(self, logger, binary="MicrosoftWebDriver.exe", port=None, - base_path="", host="localhost", args=None): - WebDriverServer.__init__( - self, logger, binary, host=host, port=port, args=args) - - def make_command(self): - return [self.binary, - "--port=%s" % str(self.port)] + self._args - - class InternetExplorerDriverServer(WebDriverServer): def __init__(self, logger, binary="IEDriverServer.exe", port=None, base_path="", host="localhost", args=None): diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptcommandline.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptcommandline.py index b232462d915a..ad18e424cd56 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptcommandline.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptcommandline.py @@ -28,7 +28,7 @@ def require_arg(kwargs, name, value_func=None): if value_func is None: value_func = lambda x: x is not None - if not name in kwargs or not value_func(kwargs[name]): + if name not in kwargs or not value_func(kwargs[name]): print >> sys.stderr, "Missing required argument %s" % name sys.exit(1) @@ -97,7 +97,8 @@ def create_parser(product_choices=None): test_selection_group.add_argument("--skip-timeout", action="store_true", help="Skip tests that are expected to time out") test_selection_group.add_argument("--tag", action="append", dest="tags", - help="Labels applied to tests to include in the run. Labels starting dir: are equivalent to top-level directories.") + help="Labels applied to tests to include in the run. " + "Labels starting dir: are equivalent to top-level directories.") debugging_group = parser.add_argument_group("Debugging") debugging_group.add_argument('--debugger', const="__default__", nargs="?", @@ -479,7 +480,8 @@ def create_parser_update(product_choices=None): help="Don't create a VCS commit containing the changes.") parser.add_argument("--sync", dest="sync", action="store_true", default=False, help="Sync the tests with the latest from upstream (implies --patch)") - parser.add_argument("--ignore-existing", action="store_true", help="When updating test results only consider results from the logfiles provided, not existing expectations.") + parser.add_argument("--ignore-existing", action="store_true", + help="When updating test results only consider results from the logfiles provided, not existing expectations.") parser.add_argument("--stability", nargs="?", action="store", const="unstable", default=None, help=("Reason for disabling tests. When updating test results, disable tests that have " "inconsistent results across many runs with the given reason.")) diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py index 6db2cbbbb477..6908ea4c1e02 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py @@ -211,15 +211,15 @@ def test_escape_11(self): """) def test_atom_1(self): - self.compare(r"""key: @True + self.compare(r"""key: @True """) def test_atom_2(self): - self.compare(r"""key: @False + self.compare(r"""key: @False """) def test_atom_3(self): - self.compare(r"""key: @Reset + self.compare(r"""key: @Reset """) def test_atom_4(self): diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_tokenizer.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_tokenizer.py index 88176c5a1690..a64ce0c7bb7d 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_tokenizer.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptmanifest/tests/test_tokenizer.py @@ -145,8 +145,7 @@ def test_key_14(self): (token_types.string, r"\nb")]) def test_list_0(self): - self.compare( -""" + self.compare(""" key: []""", [(token_types.string, "key"), (token_types.separator, ":"), @@ -154,8 +153,7 @@ def test_list_0(self): (token_types.list_end, "]")]) def test_list_1(self): - self.compare( -""" + self.compare(""" key: [a, "b"]""", [(token_types.string, "key"), (token_types.separator, ":"), @@ -165,8 +163,7 @@ def test_list_1(self): (token_types.list_end, "]")]) def test_list_2(self): - self.compare( -""" + self.compare(""" key: [a, b]""", [(token_types.string, "key"), @@ -177,8 +174,7 @@ def test_list_2(self): (token_types.list_end, "]")]) def test_list_3(self): - self.compare( -""" + self.compare(""" key: [a, #b] c]""", [(token_types.string, "key"), @@ -199,18 +195,16 @@ def test_list_5(self): c]""") def test_list_6(self): - self.compare( -"""key: [a , b]""", - [(token_types.string, "key"), - (token_types.separator, ":"), - (token_types.list_start, "["), - (token_types.string, "a"), - (token_types.string, "b"), - (token_types.list_end, "]")]) + self.compare("""key: [a , b]""", + [(token_types.string, "key"), + (token_types.separator, ":"), + (token_types.list_start, "["), + (token_types.string, "a"), + (token_types.string, "b"), + (token_types.list_end, "]")]) def test_expr_0(self): - self.compare( -""" + self.compare(""" key: if cond == 1: value""", [(token_types.string, "key"), @@ -224,8 +218,7 @@ def test_expr_0(self): (token_types.string, "value")]) def test_expr_1(self): - self.compare( -""" + self.compare(""" key: if cond == 1: value1 value2""", @@ -241,8 +234,7 @@ def test_expr_1(self): (token_types.string, "value2")]) def test_expr_2(self): - self.compare( -""" + self.compare(""" key: if cond=="1": value""", [(token_types.string, "key"), @@ -256,8 +248,7 @@ def test_expr_2(self): (token_types.string, "value")]) def test_expr_3(self): - self.compare( -""" + self.compare(""" key: if cond==1.1: value""", [(token_types.string, "key"), @@ -271,8 +262,7 @@ def test_expr_3(self): (token_types.string, "value")]) def test_expr_4(self): - self.compare( - """ + self.compare(""" key: if cond==1.1 and cond2 == "a": value""", [(token_types.string, "key"), @@ -290,8 +280,7 @@ def test_expr_4(self): (token_types.string, "value")]) def test_expr_5(self): - self.compare( -""" + self.compare(""" key: if (cond==1.1 ): value""", [(token_types.string, "key"), @@ -307,8 +296,7 @@ def test_expr_5(self): (token_types.string, "value")]) def test_expr_6(self): - self.compare( -""" + self.compare(""" key: if "\\ttest": value""", [(token_types.string, "key"), @@ -322,27 +310,26 @@ def test_expr_6(self): def test_expr_7(self): with self.assertRaises(parser.ParseError): self.tokenize( -""" + """ key: if 1A: value""") def test_expr_8(self): with self.assertRaises(parser.ParseError): self.tokenize( -""" + """ key: if 1a: value""") def test_expr_9(self): with self.assertRaises(parser.ParseError): self.tokenize( -""" + """ key: if 1.1.1: value""") def test_expr_10(self): - self.compare( -""" + self.compare(""" key: if 1.: value""", [(token_types.string, "key"), diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptrunner.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptrunner.py index 637cbe57b6f4..6677902a49a6 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptrunner.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wptrunner.py @@ -307,7 +307,8 @@ def main(): return start(**kwargs) except Exception: if kwargs["pdb"]: - import pdb, traceback + import pdb + import traceback print traceback.format_exc() pdb.post_mortem() else: diff --git a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wpttest.py b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wpttest.py index d283e854205d..9f4c1bed1355 100644 --- a/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wpttest.py +++ b/WebDriverTests/imported/w3c/tools/wptrunner/wptrunner/wpttest.py @@ -356,7 +356,7 @@ def from_manifest(cls, return node def update_metadata(self, metadata): - if not "url_count" in metadata: + if "url_count" not in metadata: metadata["url_count"] = defaultdict(int) for reference, _ in self.references: # We assume a naive implementation in which a url with multiple diff --git a/WebDriverTests/imported/w3c/webdriver/tests/execute_async_script/__init__.py b/WebDriverTests/imported/w3c/webdriver/tests/execute_async_script/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/WebDriverTests/imported/w3c/webdriver/tests/execute_script/__init__.py b/WebDriverTests/imported/w3c/webdriver/tests/execute_script/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/response.py b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/response.py index 0bec23f9990d..c9a8c766eca4 100644 --- a/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/response.py +++ b/WebDriverTests/imported/w3c/webdriver/tests/sessions/new_session/response.py @@ -50,5 +50,5 @@ def test_timeouts(new_session, add_browser_capabilites, platform_name): } def test_pageLoadStrategy(new_session, add_browser_capabilites, platform_name): - resp, _ = new_session({"capabilities": add_browser_capabilites({"alwaysMatch": {"pageLoadStrategy": "eager"}})}) + resp, _ = new_session({"capabilities": {"alwaysMatch": add_browser_capabilites({"pageLoadStrategy": "eager"})}}) assert resp["capabilities"]["pageLoadStrategy"] == "eager"