in the __init__.py of my.addon i set hard a breakpoint(). for me it means "wait if the addon is loaded/installed". this was the plan.
Now my Question. If i run zope-testrunner -pvcx --test-path=src -t TestCase1 or zope-testrunner -pvcx --test-path=src -t TestCase2 all is fine. The breakpoint bring me in the debugger console.
But if i run zope-testrunner -pvcx --test-path=src -t TestCase, it should be run TestCase1 and then TestCase2 Cases together, then surprise, My expectations were not met. the debugger come only once, not twice.
I think, it has to be with the zope.startup and the construction of the dummy zopedb. But i don't know. Can anyone help me to setup the layers correctly. Background, i would like load a configuration at startup in the package. but the tests fails, because i can't do this twice in different layers.
that is my simple testsetup
class Layer1(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)
def setUpZope(self, app, configurationContext):
self.loadZCML(package=my.addon)
def setUpPloneSite(self, portal):
applyProfile(portal, "my.addon:default")
FIXTURE1 = Layer1()
INTEGRATION_TESTING1 = IntegrationTesting(
bases=(FIXTURE1,),
name="MY.ADDON:IntegrationTesting1",
)
class Layer2(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)
def setUpZope(self, app, configurationContext):
self.loadZCML(package=my.addon)
def setUpPloneSite(self, portal):
applyProfile(portal, "my.addon:default")
FIXTURE2 = Layer2()
INTEGRATION_TESTING2 = IntegrationTesting(
bases=(FIXTURE2,),
name="MY.ADDON:IntegrationTesting2",
)
from my.addon.testing import INTEGRATION_TESTING1
from my.addon.testing import INTEGRATION_TESTING2
import unittest
class TestCase1(unittest.TestCase):
layer = INTEGRATION_TESTING1
def test_config(self):
pass
class TestCase2(unittest.TestCase):
layer = INTEGRATION_TESTING2
def test_config(self):
pass
Does anyone have any advice for me?