From 4426060206264a0628b5340aaa8c8a784f27301b Mon Sep 17 00:00:00 2001 From: Asko Soukka Date: Sat, 7 May 2022 19:39:48 +0300 Subject: [PATCH] Try giving test scope WSGI SERVER fixture PLONE_FIXTURE as base to ensure it is called after PLONE_FIXTURE --- src/plone/app/robotframework/testing.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plone/app/robotframework/testing.py b/src/plone/app/robotframework/testing.py index aef7bcc..8d8a6dd 100644 --- a/src/plone/app/robotframework/testing.py +++ b/src/plone/app/robotframework/testing.py @@ -137,7 +137,7 @@ def tearDown(self): # /> # -class TestScopeWSGIServer(WSGIServer): +class WSGIServerTestScope(WSGIServer): # Layer where WSGI server is shutdown on testTearDown to prevent requests # being processed between tests (which could lead to unexpected database @@ -147,15 +147,17 @@ class TestScopeWSGIServer(WSGIServer): # for convenience and similar "RobotServer" experience to the default # layer. + bases = (PLONE_FIXTURE,) + def testSetUp(self): if hasattr(self, "server") and self.server.was_shutdown: - super(TestScopeWSGIServer, self).setUp() + super(WSGIServerTestScope, self).setUp() def tearDown(self): pass def testTearDown(self): - super(TestScopeWSGIServer, self).tearDown() + super(WSGIServerTestScope, self).tearDown() # Try to wait until server no longer responds. if hasattr(self, "server"): for i in range(10): @@ -164,7 +166,7 @@ def testTearDown(self): return -TEST_SCOPE_WSGI_SERVER_FIXTURE = TestScopeWSGIServer() +WSGI_SERVER_TEST_SCOPE_FIXTURE = WSGIServerTestScope() RobotRemote = type( @@ -316,7 +318,7 @@ def __nonzero__(x): bases=( PLONE_ROBOT_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, - TEST_SCOPE_WSGI_SERVER_FIXTURE, + WSGI_SERVER_TEST_SCOPE_FIXTURE, ), name="Plone:Robot", )