Skip to content

Commit

Permalink
Try giving test scope WSGI SERVER fixture PLONE_FIXTURE as base to en…
Browse files Browse the repository at this point in the history
…sure it is called after PLONE_FIXTURE
  • Loading branch information
datakurre committed May 7, 2022
1 parent 6ee97db commit 4426060
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/plone/app/robotframework/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand All @@ -164,7 +166,7 @@ def testTearDown(self):
return


TEST_SCOPE_WSGI_SERVER_FIXTURE = TestScopeWSGIServer()
WSGI_SERVER_TEST_SCOPE_FIXTURE = WSGIServerTestScope()


RobotRemote = type(
Expand Down Expand Up @@ -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",
)
Expand Down

0 comments on commit 4426060

Please sign in to comment.