Bug 1319237 - Make session fixture module scoped; r?jgraham draft
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 21 Nov 2016 23:39:42 +0100
changeset 479494 6d6900adfcedb494a635d73f376d32107d287f39
parent 479493 0946938ec4800925203b0020fede5388ebc1a05b
child 479495 6cef8dd2476350c105231ebdeed628d72547f34a
push id44268
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 19:54:40 +0000
reviewersjgraham
bugs1319237
milestone54.0a1
Bug 1319237 - Make session fixture module scoped; r?jgraham I recently changed it to function scoped, which was a mistake. pytest complains if it is not module scoped. MozReview-Commit-ID: GYP9Ky1avks
testing/web-platform/harness/wptrunner/executors/pytestrunner/fixtures.py
--- a/testing/web-platform/harness/wptrunner/executors/pytestrunner/fixtures.py
+++ b/testing/web-platform/harness/wptrunner/executors/pytestrunner/fixtures.py
@@ -53,17 +53,17 @@ class Session(object):
     When the test function goes out of scope, any remaining user prompts
     and opened windows are closed, and the current browsing context is
     switched back to the top-level browsing context.
     """
 
     def __init__(self, client):
         self.client = client
 
-    @pytest.fixture(scope="function")
+    @pytest.fixture(scope="module")
     def session(self, request):
         # finalisers are popped off a stack,
         # making their ordering reverse
         request.addfinalizer(self.switch_to_top_level_browsing_context)
         request.addfinalizer(self.restore_windows)
         request.addfinalizer(self.dismiss_user_prompts)
 
         return self.client