<div dir="ltr"><div>I'll try to give a try to test issues during the weekend, I promise :D<br></div><div>TurboGears 2.3.8 also got released so I can switch code to tgext.routes and remove the need to pull from github.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 8:09 PM, Thomas De Schampheleire <span dir="ltr"><<a href="mailto:patrickdepinguin@gmail.com" target="_blank">patrickdepinguin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alessandro,<br>
<div><div class="h5"><br>
On Wed, Feb 24, 2016 at 2:38 PM, Alessandro Molina<br>
<<a href="mailto:alessandro.molina@gmail.com">alessandro.molina@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, Feb 19, 2016 at 10:20 PM, Thomas De Schampheleire<br>
> <<a href="mailto:patrickdepinguin@gmail.com">patrickdepinguin@gmail.com</a>> wrote:<br>
>><br>
>> Currently the test initialization code has<br>
>> some pylons specifics which I don't understand (and thus fail to<br>
>> convert to a Turbogears equivalent).<br>
>><br>
>> Essentially, the setup code in TestController is:<br>
>><br>
>>         self.wsgiapp = pylons.test.pylonsapp<br>
>>         init_stack(self.wsgiapp.config)<br>
>>         self.app = TestApp(self.wsgiapp)<br>
>><br>
>> with init_stack being:<br>
>><br>
>> def init_stack(config=None):<br>
><br>
><br>
> I didn't have time to look at it so far, sorry, but by a quick view of what<br>
> init_stack is doing it looks like it's mostly setting up the Pylons global<br>
> objects even when not inside a request. That should be fairly equivalent to<br>
> performing a request to '/_test_vars' in TurboGears or using<br>
> <a href="http://turbogears.readthedocs.org/en/latest/reference/classes.html#tg.util.webtest.test_context" rel="noreferrer" target="_blank">http://turbogears.readthedocs.org/en/latest/reference/classes.html#tg.util.webtest.test_context</a><br>
><br>
> See<br>
> <a href="http://turbogears.readthedocs.org/en/latest/turbogears/testing.html#testing-outside-controllers" rel="noreferrer" target="_blank">http://turbogears.readthedocs.org/en/latest/turbogears/testing.html#testing-outside-controllers</a><br>
> it might provide a few useful details.<br>
><br>
<br>
</div></div>So I've been spending quite some time in trying to get the test suite<br>
working but failed miserably.<br>
I looked at the references you sent, looked at the test suite of an<br>
example tg2 project, and tried to apply the same principles to our<br>
test suite, but I keep getting an error in the application setup.<br>
<br>
I created a dummy test that does not use the application itself, to<br>
verify the init code of the test suite, and try to run it with:<br>
<br>
$ py.test kallithea/tests/other/test_dummy.py<br>
<br>
Then I get an error that seems to indicate that the model is not<br>
correctly initialized.<br>
I tried adding traces to see what's going on, and tried many things,<br>
but could not get it to work.<br>
The fact that we're in a transition from nosetest to pytest does not<br>
really help either. In any case, the first focus is to getting the<br>
TestControllerPytest to work; I hope that soon all tests will be<br>
switched to it.<br>
<br>
In a separate mail I am sending the code I was last working with,<br>
along with the full error I'm seeing.<br>
If and when you have some time, could you have a look? Any help in<br>
progressing here is more than welcome!<br>
<br>
Thanks,<br>
Thomas<br>
</blockquote></div><br></div>