Bug 1319237 - Allow pytests to be skipped imperatively at runtime. r=jgraham, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 21 Nov 2016 23:38:42 +0100
changeset 378501 5384084ee6d3b204f9ce090f802f73b9b405e5a0
parent 378500 20b7c1a2b0ce4951b0645d1151f98f7ee73ef983
child 378502 56a0e1f88578639a15e008ed4564408f8319bbd2
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham, test-only
bugs1319237
milestone53.0a2
Bug 1319237 - Allow pytests to be skipped imperatively at runtime. r=jgraham, a=test-only It is required to skip certain WebDriver tests imperatively at runtime, such as for the Get Window Size and Get Window Position commands, which are only available at certain configurations. MozReview-Commit-ID: 9ERYkYm34iI
testing/web-platform/harness/wptrunner/executors/pytestrunner/runner.py
--- a/testing/web-platform/harness/wptrunner/executors/pytestrunner/runner.py
+++ b/testing/web-platform/harness/wptrunner/executors/pytestrunner/runner.py
@@ -84,19 +84,17 @@ class SubtestResultRecorder(object):
 
     def record_error(self, report):
         # error in setup/teardown
         if report.when != "call":
             message = "%s error" % report.when
         self.record(report.nodeid, "ERROR", message, report.longrepr)
 
     def record_skip(self, report):
-        self.record(report.nodeid, "ERROR",
-                    "In-test skip decorators are disallowed, "
-                    "please use WPT metadata to ignore tests.")
+        self.record(report.nodeid, "PASS")
 
     def record(self, test, status, message=None, stack=None):
         if stack is not None:
             stack = str(stack)
         new_result = (test, status, message, stack)
         self.results.append(new_result)