From 8316b30ae6240787a869b22b05eddc1003b9e1fc Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Sat, 29 Jun 2019 19:35:42 +0200 Subject: [PATCH] Fix injection of ZopeLite test configuration into the global Zope configuration. Fixese #64 --- news/xx.bugfix | 3 +++ src/plone/testing/zope.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 news/xx.bugfix diff --git a/news/xx.bugfix b/news/xx.bugfix new file mode 100644 index 0000000..73e6783 --- /dev/null +++ b/news/xx.bugfix @@ -0,0 +1,3 @@ +Fix injection of ZopeLite test configuration into the global Zope configuration. +Fixese #64 +[thet] diff --git a/src/plone/testing/zope.py b/src/plone/testing/zope.py index 6af2c81..b2f6c56 100644 --- a/src/plone/testing/zope.py +++ b/src/plone/testing/zope.py @@ -7,7 +7,6 @@ from plone.testing import zca from plone.testing import zodb from plone.testing._z2_testbrowser import Browser # noqa -from Testing.ZopeTestCase.ZopeLite import _patched as ZOPETESTCASEALERT from webtest.http import StopableWSGIServer from Zope2.App.schema import Zope2VocabularyRegistry from zope.schema.vocabulary import getVocabularyRegistry @@ -461,6 +460,11 @@ def setUpDatabase(self): that the database that is opened by Zope 2 is in fact the top of the resource stack. """ + + # NOTE: Keep that import here. + # Having it on module-level has the side effect of injecting the + # ZopeLite test configuration into the global Zope configuration. + from Testing.ZopeTestCase.ZopeLite import _patched as ZOPETESTCASEALERT if ZOPETESTCASEALERT: raise Exception('You try to run plone.testing tests together with ' 'ZopeTestCase tests. This will result in random '