Bug 1319237 - Make session fixture module scoped; r?jgraham draft
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 21 Nov 2016 23:39:42 +0100
changeset 442940 4f2640a44196f3743c2ea84cbd5f8d271889e9cd
parent 442939 5061c610258160d2db04eba9b6fa8f0e34620e3a
child 442941 5f99ce6405ced8d073a046dcf443adf4f017baf2
push id36873
push userbmo:ato@mozilla.com
push dateWed, 23 Nov 2016 16:03:30 +0000
reviewersjgraham
bugs1319237
milestone53.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
@@ -52,17 +52,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