<div dir="ltr"><div><div><div>...And you don't get failures from running<br>KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests kallithea/tests/functional/ <br></div>? Because I do.<br><br>Ran 383 tests in 125.998s<br>FAILED (SKIP=5, errors=10, failures=19)<br><br>I put some print statements into load_environment and it looks to me that running under pytest, it is respecting those settings.<br><br></div>cheers<br></div>Brianna<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 4 June 2015 at 21:20, 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 Brianna, all,<br>
<br>
On Tue, Jun 2, 2015 at 6:34 PM, Thomas De Schampheleire<br>
<div><div class="h5"><<a href="mailto:patrickdepinguin@gmail.com">patrickdepinguin@gmail.com</a>> wrote:<br>
> On June 2, 2015 4:10:19 PM CEST, Brianna Laugher <<a href="mailto:brianna.laugher@gmail.com">brianna.laugher@gmail.com</a>> wrote:<br>
>>On 31 May 2015 at 12:57, Thomas De Schampheleire<br>
>><<a href="mailto:patrickdepinguin@gmail.com">patrickdepinguin@gmail.com</a><br>
>>> wrote:<br>
>><br>
>>> Hi,<br>
>>><br>
>>> I've been using pytest for a while now, and think we should consider<br>
>>> making it the default test suite instead of nose.<br>
>>><br>
>>> As I see it, there are following points to do:<br>
>>><br>
>>> 1. silence the database setup code by default. Currently, the initial<br>
>>> step of the tests sets up the database and all commands are passing<br>
>>by<br>
>>> on the terminal. This should be silent, just like with nose.<br>
>>> However, I don't know how to fix this correctly, and I hope Marc,<br>
>>> Ronny or Brianna could help here.<br>
>><br>
>><br>
>>So I downloaded kallithea and had a bit of a poke around. My impression<br>
>>is<br>
>>that the database setup is done in kallithea/tests/conftest.py<br>
>>pytest_configure, specifically loadapp. While under nosetests, more or<br>
>>less<br>
>>the same is done at pylons.tests PylonsPlugin.begin. So I think the<br>
>>Pylons<br>
>>nose plugin is suppressing all output (and in fact I couldn't make it<br>
>>deliberately show me the output).<br>
><br>
> IIRC, 'nosetests -s' shows that output.<br>
><br>
>><br>
>>Whereas with pytest, I think it is not expecting test setup to be done<br>
>>in<br>
>>pytest_configure, and so the options for controlling output have no<br>
>>effect<br>
>>on what happens in this function.<br>
>><br>
>>So 1) Maybe pytest should be changed to allow suppression of output<br>
>>from<br>
>>pytest_configure<br>
>>or 2) Maybe this functionality belongs under a different hook function.<br>
><br>
> Any hook is fine for us, as long as it works and we can hide the output of the setup code. :)<br>
><br>
>><br>
>>With pytest style fixtures I don't think it would be a problem. However<br>
>>maybe there still would need to be something at this level, I don't<br>
>>fully<br>
>>understand the implications of what is written here re nosetest, maybe<br>
>>the<br>
>>same problems would occur with pytest.<br>
>><a href="http://pylons-webframework.readthedocs.org/en/latest/testing.html" target="_blank">http://pylons-webframework.readthedocs.org/en/latest/testing.html</a><br>
>><br>
><br>
> I have no idea about this, I guess it needs to be tried to know for sure.<br>
><br>
> Thanks for looking at this!<br>
><br>
<br>
</div></div>Another thing that is not yet working properly with pytest is the<br>
feature that runs the setup code once, and then directly starts<br>
testing, as mentioned here:<br>
<a href="http://kallithea.readthedocs.org/en/latest/contributing.html#running-tests" target="_blank">http://kallithea.readthedocs.org/en/latest/contributing.html#running-tests</a><br>
<br>
The result output of:<br>
KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 py.test<br>
kallithea/tests/functional/<br>
is:<br>
<br>
Results (239.58s):<br>
     383 passed<br>
      18 failed<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:84:<br>
AssertionError: no repo vcs_test_git_new in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:175:<br>
AssertionError: no repo ingroup in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:324:<br>
AssertionError: no repo ingroup_inherited_git in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:267:<br>
AssertionError: no repo ingroup in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:124:<br>
AssertionError: no repo vcs_test_git_newąęł in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/__init__.py:221:<br>
AssertionError: msg `Error creating repository vcs_test_git_new` not<br>
found - session has no flash<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:399:<br>
AssertionError: no repo vcs_test_new_to_delete_git in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:451:<br>
AssertionError: no repo vcs_test_git_newąęł in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:84:<br>
AssertionError: no repo vcs_test_hg_new in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:175:<br>
AssertionError: no repo ingroup in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:324:<br>
AssertionError: no repo ingroup_inherited_hg in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:267:<br>
AssertionError: no repo ingroup in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:124:<br>
AssertionError: no repo vcs_test_hg_newąęł in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/__init__.py:221:<br>
AssertionError: msg `Error creating repository vcs_test_hg_new` not<br>
found - session has no flash<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:399:<br>
AssertionError: no repo vcs_test_new_to_delete_hg in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_admin_repos.py:451:<br>
AssertionError: no repo vcs_test_hg_newąęł in filesystem<br>
         - /home/tdescham/repo/contrib/kallithea-venv/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py:445:<br>
IndexError: Body does not contain string 'var data = {"totalRecords":<br>
16'<br>
         - /home/tdescham/repo/contrib/kallithea-venv/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py:445:<br>
IndexError: Body does not contain string '{"totalRecords": 0, "sort":<br>
null, "startIndex": 0, "dir": "asc", "records": []};'<br>
<br>
<br>
Fixing this sounds like a prerequisite for pytest-as-default-test-runner too.<br>
I have no idea whether this is difficult...<br>
<br>
Best regards,<br>
Thomas<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">They've just been waiting in a mountain for the right moment: <a href="http://modernthings.org/" target="_blank">http://modernthings.org/</a></div>
</div>