Bug 1470530 - [wptrunner] Correct the warning to error option for pytest. draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 28 Jun 2018 21:42:15 +0200
changeset 813911 841452f2d674c9e757f8ddc3dc124a33bbc54fca
parent 813837 987ea0d6a000b95cf93928b25a74a7fb1dfe37b2
child 813912 87985a2364b920cb16cc34b3b0e986eae59e62b3
push id115045
push userbmo:hskupin@gmail.com
push dateWed, 04 Jul 2018 04:53:58 +0000
bugs1470530
milestone63.0a1
Bug 1470530 - [wptrunner] Correct the warning to error option for pytest. Currently the "--strict" option is used to turn warnings into errors. But even the help content says that, it is not true. Instead this option is only used for markers. To actually turn warnings into errors the "-W error" option would have to be used. More details see: https://github.com/pytest-dev/pytest/issues/2444 MozReview-Commit-ID: AQMwZlwC46w
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py
@@ -46,17 +46,17 @@ def run(path, server_config, session_con
     os.environ["WD_CAPABILITIES"] = json.dumps(session_config["capabilities"])
     os.environ["WD_SERVER_CONFIG"] = json.dumps(server_config.as_dict())
 
     harness = HarnessResultRecorder()
     subtests = SubtestResultRecorder()
 
     with TemporaryDirectory() as cache:
         try:
-            pytest.main(["--strict",  # turn warnings into errors
+            pytest.main(["-W error",  # turn warnings into errors
                          "-vv",  # show each individual subtest and full failure logs
                          "--capture", "no",  # enable stdout/stderr from tests
                          "--basetemp", cache,  # temporary directory
                          "--showlocals",  # display contents of variables in local scope
                          "-p", "no:mozlog",  # use the WPT result recorder
                          "-p", "no:cacheprovider",  # disable state preservation across invocations
                          "-o=console_output_style=classic",  # disable test progress bar
                          path],