Hi, <br><br>I have a package homeviva.testing that holds all tests from our aplication. Inside that package I added a subclass of zope.app.wsgi.testlayer.BrowserLayer that will add an instance of our grok application add then add some more dummy data as a way to provide a common test fixture to all of our integration test.<br>


<br>The layer looks like this:<br><br>from zope.app.wsgi.testlayer import BrowserLayer<br><br>class HomeVivaIntegrationLayer(BrowserLayer):<br>    &quot;&quot;&quot;<br>    Integration Layer for HomeViva.<br>    &quot;&quot;&quot;<br>


    consworks_app = None<br><br>    def testSetUp(self):<br>        super(HomeVivaIntegrationLayer, self).testSetUp()<br><br>        #Add test app<br>        from consworks.app import Consworks<br>        zodb_root = self.getRootFolder()<br>


        zodb_root[&#39;app&#39;] = self.consworks_app = Consworks()<br><br>        #Fire up events<br>        import grok<br>        grok.notify(grok.ApplicationInitializedEvent(self.consworks_app))<br><br>        #... more stuff here<br clear="all">


<br>When I run my tests individually all goes fine, but if I try to run all the tests within the package, no tests are run and a traceback is printed:<br><br>$ bin/test -s homeviva.testing <br>Running homeviva.testing.HomeVivaIntegrationLayer tests:<br>


  Set up homeviva.testing.HomeVivaIntegrationLayer in 4.660 seconds.<br>  Running:<br>    2/4 (50.0%)<br>Traceback (most recent call last):<br>  File &quot;bin/test&quot;, line 222, in &lt;module&gt;<br>    &#39;--test-path&#39;, &#39;/home/tzicatl/Aplicaciones/Codigo/HomeViva/homeviva_assembla/src/homeviva.reminder&#39;,<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/__init__.py&quot;, line 30, in run<br>    failed = run_internal(defaults, args, script_parts=script_parts)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/__init__.py&quot;, line 43, in run_internal<br>


    runner.run()<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/runner.py&quot;, line 148, in run<br>    self.run_tests()<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/runner.py&quot;, line 229, in run_tests<br>


    setup_layers, self.failures, self.errors)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/runner.py&quot;, line 390, in run_layer<br>    return run_tests(options, tests, layer_name, failures, errors)<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/runner.py&quot;, line 318, in run_tests<br>    test(result)<br>  File &quot;/usr/lib64/python2.7/unittest/case.py&quot;, line 391, in __call__<br>


    return self.run(*args, **kwds)<br>  File &quot;/usr/lib64/python2.7/unittest/case.py&quot;, line 302, in run<br>    result.startTest(self)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/runner.py&quot;, line 726, in startTest<br>


    self.testSetUp()<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.testrunner-4.0.3-py2.7.egg/zope/testrunner/runner.py&quot;, line 711, in testSetUp<br>    layer.testSetUp()<br>  File &quot;/home/tzicatl/Aplicaciones/Codigo/HomeViva/homeviva_assembla/src/homeviva.testing/homeviva/testing/integration.py&quot;, line 13, in testSetUp<br>


    super(HomeVivaIntegrationLayer, self).testSetUp()<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.app.wsgi-3.13.0-py2.7.egg/zope/app/wsgi/testlayer.py&quot;, line 75, in testSetUp<br>    super(BrowserLayer, self).testSetUp()<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.app.appsetup-3.15.0-py2.7.egg/zope/app/appsetup/testlayer.py&quot;, line 64, in testSetUp<br>    self.db = createTestDB(self.db_name)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.app.appsetup-3.15.0-py2.7.egg/zope/app/appsetup/testlayer.py&quot;, line 39, in createTestDB<br>


    notify(zope.processlifetime.DatabaseOpened(db))<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.event-3.5.0_1-py2.7.egg/zope/event/__init__.py&quot;, line 23, in notify<br>    subscriber(event)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/event.py&quot;, line 24, in dispatch<br>


    zope.component.subscribers(event, None)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/_api.py&quot;, line 136, in subscribers<br>    return sitemanager.subscribers(objects, interface)<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/registry.py&quot;, line 321, in subscribers<br>    return self.adapters.subscribers(objects, provided)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.interface-3.6.3-py2.7-linux-x86_64.egg/zope/interface/adapter.py&quot;, line 583, in subscribers<br>


    subscription(*objects)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.app.appsetup-3.15.0-py2.7.egg/zope/app/appsetup/bootstrap.py&quot;, line 168, in bootStrapSubscriber<br>    site_manager = site.LocalSiteManager(root_folder)<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.site-3.9.2-py2.7.egg/zope/site/site.py&quot;, line 158, in __init__<br>    self[&#39;default&#39;] = folder<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.container-3.12.0-py2.7-linux-x86_64.egg/zope/container/btree.py&quot;, line 112, in __setitem__<br>


    setitem(self, self._setitemf, key, value)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.container-3.12.0-py2.7-linux-x86_64.egg/zope/container/contained.py&quot;, line 559, in setitem<br>    notify(event)<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.event-3.5.0_1-py2.7.egg/zope/event/__init__.py&quot;, line 23, in notify<br>    subscriber(event)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/event.py&quot;, line 24, in dispatch<br>


    zope.component.subscribers(event, None)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/_api.py&quot;, line 136, in subscribers<br>    return sitemanager.subscribers(objects, interface)<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/registry.py&quot;, line 321, in subscribers<br>    return self.adapters.subscribers(objects, provided)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.interface-3.6.3-py2.7-linux-x86_64.egg/zope/interface/adapter.py&quot;, line 583, in subscribers<br>


    subscription(*objects)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/event.py&quot;, line 32, in objectEventNotify<br>    zope.component.subscribers((event.object, event), None)<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/_api.py&quot;, line 136, in subscribers<br>    return sitemanager.subscribers(objects, interface)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/registry.py&quot;, line 321, in subscribers<br>


    return self.adapters.subscribers(objects, provided)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.interface-3.6.3-py2.7-linux-x86_64.egg/zope/interface/adapter.py&quot;, line 583, in subscribers<br>    subscription(*objects)<br>


  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.intid-3.7.2-py2.7.egg/zope/intid/__init__.py&quot;, line 166, in addIntIdSubscriber<br>    key = IKeyReference(ob, None)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.component-3.10.0-py2.7.egg/zope/component/hooks.py&quot;, line 104, in adapter_hook<br>


    return siteinfo.adapter_hook(interface, object, name, default)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.security-3.8.2-py2.7-linux-x86_64.egg/zope/security/adapter.py&quot;, line 86, in __call__<br>


    adapter = self.factory(*args)<br>  File &quot;/home/tzicatl/Aplicaciones/Buildout/eggs/zope.keyreference-3.6.2-py2.7.egg/zope/keyreference/persistent.py&quot;, line 40, in __init__<br>    raise zope.keyreference.interfaces.NotYet(object)<br>


zope.keyreference.interfaces.NotYet: &lt;zope.site.site.SiteManagementFolder object at 0x5b725f0&gt;<br><br><br>line 13, in testSetUp is this one: super(HomeVivaIntegrationLayer, self).testSetUp()<br><br>What am I doing wrong?<br>

<br>-- <br><span style="color:rgb(255,204,102)">---</span><br>
<span style="color:rgb(204,153,51)">Noe Nieto</span><br>
NNieto Consulting Services<br>
M: <a href="mailto:nnieto@noenieto.com" target="_blank">nnieto@noenieto.com</a><br>
W: <a href="http://noenieto.com" target="_blank">http://noenieto.com</a><br>
T:  <a href="https://twitter.com/#%21/tzicatl" target="_blank">@tzicatl</a><br>Li: <a href="http://www.linkedin.com/profile/view?id=84300665" target="_blank">Perfil en LinkedIn</a><br><br>