Bug 1319237 - Make session fixture module scoped; r=jgraham draft
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 21 Nov 2016 23:39:42 +0100
changeset 482813 0776803493f7175d1c408c50f06fa6112c196abc
parent 482812 5fed98284ab6f32009cdb1fa819cf2337adb4a73
child 482814 88647b1c7115f15649d5029391ff21567f9d527c
push id45172
push userbmo:ato@mozilla.com
push dateMon, 13 Feb 2017 14:08:30 +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