<div class="gmail_extra">That didn&#39;t work either.<br><br>I did some thorough test until I reached to a case where only two integration tests are declared within homeviva.testing (the rest of them are unittests):<br><br>

#Python libraries<br>import unittest<br><br>#Grok &amp; Zope<br>from zope.app.wsgi.testlayer import BrowserLayer<br><br>#The homeviva/consworks namespace<br>import homeviva.testing<br>from homeviva.testing.fixtures import (<br>

    setUpConsworksFixture,<br>    tearDownConsworksFixture<br>)<br><br>class FooTestCase(unittest.TestCase):<br>    layer = BrowserLayer(homeviva.testing)<br><br>    def setUp(self):<br>        zodb_root = self.layer.get_app().wsgi_stack.root_factory()<br>

        setUpConsworksFixture(self, zodb_root)<br><br>    def tearDown(self):<br>        zodb_root = self.layer.get_app().wsgi_stack.root_factory()<br>        tearDownConsworksFixture(self, zodb_root)<br><br>    def test_sanity(self):<br>

        self.assertTrue(0==0)<br><br>class BarTestCase(unittest.TestCase):<br>    layer = BrowserLayer(homeviva.testing)<br><br>    def setUp(self):<br>        zodb_root = self.layer.get_app().wsgi_stack.root_factory()<br>

        setUpConsworksFixture(self, zodb_root)<br><br>    def tearDown(self):<br>        zodb_root = self.layer.get_app().wsgi_stack.root_factory()<br>        tearDownConsworksFixture(self, zodb_root)<br><br>    def test_sanity(self):<br>

        self.assertTrue(0==0)<br><br>And these are the fixture functions:<br><br>import time<br>from grok.util import create_application<br><br>def setUpConsworksFixture(self, zodb_root):<br>    #select appname<br>    self.appname = &#39;&#39;.join(str(time.time()).split(&#39;.&#39;))<br>

<br><br>def tearDownConsworksFixture(self, zodb_root):<br>    del zodb_root[self.appname]<br>    del self.consworks_app<br><br>There&#39;s no custom layer anymore and I&#39;m still getting the traceback. The traceback is thrown only If I run all the tests (e.g. bin/test -s homeviva.testing) and not when I run a particular test (bin/test -s homeviva.testing  -t FooTestCase). Also, it is never thrown when adding one instance through the Grok controlpanel.<br>

<br>The Consworks Object does some complex application initalization based on decorators. Would that be the cause of this issue?<br><br>---<br>Noe<br><br><div class="gmail_quote">2012/4/25 Jan-Jaap Driessen <span dir="ltr">&lt;<a href="mailto:jdriessen@minddistrict.com" target="_blank">jdriessen@minddistrict.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 25 April 2012 07:17, Noe Nieto &lt;<a href="mailto:nnieto@noenieto.com">nnieto@noenieto.com</a>&gt; wrote:<br>


&gt; Hi,<br>
&gt;<br>
&gt; I have a package homeviva.testing that holds all tests from our aplication.<br>
&gt; Inside that package I added a subclass of<br>
&gt; zope.app.wsgi.testlayer.BrowserLayer that will add an instance of our grok<br>
&gt; application add then add some more dummy data as a way to provide a common<br>
&gt; test fixture to all of our integration test.<br>
&gt;<br>
&gt; The layer looks like this:<br>
&gt;<br>
&gt; from zope.app.wsgi.testlayer import BrowserLayer<br>
&gt;<br>
&gt; class HomeVivaIntegrationLayer(BrowserLayer):<br>
&gt;     &quot;&quot;&quot;<br>
&gt;     Integration Layer for HomeViva.<br>
&gt;     &quot;&quot;&quot;<br>
&gt;     consworks_app = None<br>
&gt;<br>
&gt;     def testSetUp(self):<br>
&gt;         super(HomeVivaIntegrationLayer, self).testSetUp()<br>
&gt;<br>
&gt;         #Add test app<br>
&gt;         from consworks.app import Consworks<br>
&gt;         zodb_root = self.getRootFolder()<br>
&gt;         zodb_root[&#39;app&#39;] = self.consworks_app = Consworks()<br>
&gt;<br>
&gt;         #Fire up events<br>
&gt;         import grok<br>
&gt;         grok.notify(grok.ApplicationInitializedEvent(self.consworks_app))<br>
&gt;<br>
&gt;         #... more stuff here<br>
&gt;<br>
&gt; When I run my tests individually all goes fine, but if I try to run all the<br>
&gt; tests within the package, no tests are run and a traceback is printed:<br>
&gt;<br>
&gt; $ bin/test -s homeviva.testing<br>
&gt; Running homeviva.testing.HomeVivaIntegrationLayer tests:<br>
</div></div>...<br>
<div class="im">&gt; What am I doing wrong?<br>
<br>
</div>Hi Noe,<br>
<br>
We had the same issue a while ago. JW knows the details, I only<br>
remember we moved the setup of test fixtures from the layer&#39;s<br>
testSetUp to the setUp of the individual TestCases.<br>
<br>
Cheers,<br>
<br>
JJ<br>
</blockquote></div><br><br clear="all"><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>
</div>