Making pytest the standard test suite (instead of nose)

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Jun 2 12:34:32 EDT 2015


On June 2, 2015 4:10:19 PM CEST, Brianna Laugher <brianna.laugher at gmail.com> wrote:
>On 31 May 2015 at 12:57, Thomas De Schampheleire
><patrickdepinguin at gmail.com
>> wrote:
>
>> Hi,
>>
>> I've been using pytest for a while now, and think we should consider
>> making it the default test suite instead of nose.
>>
>> As I see it, there are following points to do:
>>
>> 1. silence the database setup code by default. Currently, the initial
>> step of the tests sets up the database and all commands are passing
>by
>> on the terminal. This should be silent, just like with nose.
>> However, I don't know how to fix this correctly, and I hope Marc,
>> Ronny or Brianna could help here.
>
>
>So I downloaded kallithea and had a bit of a poke around. My impression
>is
>that the database setup is done in kallithea/tests/conftest.py
>pytest_configure, specifically loadapp. While under nosetests, more or
>less
>the same is done at pylons.tests PylonsPlugin.begin. So I think the
>Pylons
>nose plugin is suppressing all output (and in fact I couldn't make it
>deliberately show me the output).

IIRC, 'nosetests -s' shows that output.

>
>Whereas with pytest, I think it is not expecting test setup to be done
>in
>pytest_configure, and so the options for controlling output have no
>effect
>on what happens in this function.
>
>So 1) Maybe pytest should be changed to allow suppression of output
>from
>pytest_configure
>or 2) Maybe this functionality belongs under a different hook function.

Any hook is fine for us, as long as it works and we can hide the output of the setup code. :)

>
>With pytest style fixtures I don't think it would be a problem. However
>maybe there still would need to be something at this level, I don't
>fully
>understand the implications of what is written here re nosetest, maybe
>the
>same problems would occur with pytest.
>http://pylons-webframework.readthedocs.org/en/latest/testing.html
>

I have no idea about this, I guess it needs to be tried to know for sure.

Thanks for looking at this!

Best regards,
Thomas




More information about the kallithea-general mailing list