Bug 1319237 - Make session fixture module scoped; r?jgraham draft
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 21 Nov 2016 23:39:42 +0100
changeset 479401 0469dce76124d18c153ceecec5d9e8dbf2da1c63
parent 479400 d4959ce127df8f88f78dafcfbba1195444f9a3ee
child 479402 64427a6f82c592729a9853298f2b86d6ab293bbb
push id44243
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 16:11:43 +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