<br><br><div class="gmail_quote">On Mon, Dec 6, 2010 at 9:50 AM, holger krekel <span dir="ltr">&lt;<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, Dec 06, 2010 at 09:00 -0500, Alfredo Deza wrote:<br>
&gt; On Mon, Dec 6, 2010 at 8:46 AM, holger krekel &lt;<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; just released an initial version 0.6 of the pytest-pep8 plugin,<br>
&gt; &gt; integrating the ``pep8`` module into py.test runs, allowing full<br>
&gt; &gt; per-project customization and configuration.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; This looks very useful as py.test plugin.<br>
&gt;<br>
&gt; Is there any way of getting junit output from it? This would help when using<br>
&gt; it with Hudson.<br>
&gt;<br>
&gt; We already use the junit flag to output test results but wanted to add<br>
&gt; something like the pep8 plugin<br>
&gt; for correctness :)<br>
<br>
</div>Heh, &lt;borrowing-time-machine&gt; actually<br>
<br>
    py.test --pep8 --junitxml=mypath.xml<br>
<br>
should present all PEP8 errors or warnings in the JunitXML file.<br>
If not, i&#39;d consider it a bug which you can report or fix<br>
with the <a href="http://bitbucket.org/hpk42/pytest-pep8" target="_blank">http://bitbucket.org/hpk42/pytest-pep8</a> repo.<br></blockquote><div><br></div><div>Ok great, so no &quot;extras&quot; are involved to make it output to the JunitXML file. Nice. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
sidenote: i am not sure about the default behaviour - would it<br>
maybe make sense to start out with warning/erroring on everything<br>
and leaving it to project-specific configuration which warnings<br>
and pep8 errors to ignore?<br></blockquote><div><br></div><div>I think it is safe to assume that if you are using this plugin you want everything</div><div>&quot;ON&quot; by default, so you can see what things you are interested in and tweak (turn off)</div>
<div>as you progress. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
cheers,<br>
<font color="#888888">holger<br>
</font><div><div></div><div class="h5"><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &gt; See <a href="http://pypi.python.org/pypi/pytest-pep8" target="_blank">http://pypi.python.org/pypi/pytest-pep8</a> for installation<br>
&gt; &gt; and configuration instructions.<br>
&gt; &gt;<br>
&gt; &gt; best,<br>
&gt; &gt; holger<br>
&gt; &gt;<br>
&gt; &gt; Usage<br>
&gt; &gt; -----------------<br>
&gt; &gt;<br>
&gt; &gt; install pytest-pep8 via::<br>
&gt; &gt;<br>
&gt; &gt;    easy_install pytest-pep8 # or<br>
&gt; &gt;    pip install pytest-pep8<br>
&gt; &gt;<br>
&gt; &gt; and then type::<br>
&gt; &gt;<br>
&gt; &gt;    py.test --pep8<br>
&gt; &gt;<br>
&gt; &gt; to activate source code checking. Every file ending in ``.py`` will be<br>
&gt; &gt; discovered and checked, starting from the command line arguments.<br>
&gt; &gt; For example, if you have a file like this::<br>
&gt; &gt;<br>
&gt; &gt;    # content of myfile.py<br>
&gt; &gt;<br>
&gt; &gt;    somefunc( 123,456)<br>
&gt; &gt;<br>
&gt; &gt; you can run it with::<br>
&gt; &gt;<br>
&gt; &gt;    $ py.test --pep8<br>
&gt; &gt;    =========================== test session starts<br>
&gt; &gt; ============================<br>
&gt; &gt;    platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev1<br>
&gt; &gt;    pep8 ignore opts: E202 E221 E222 E241 E301 E302 E401 E501 E701 W293 W391<br>
&gt; &gt; W601 W602<br>
&gt; &gt;    collecting ... collected 1 items<br>
&gt; &gt;<br>
&gt; &gt;    myfile.py F<br>
&gt; &gt;<br>
&gt; &gt;    ================================= FAILURES<br>
&gt; &gt; =================================<br>
&gt; &gt;    ________________________________ PEP8-check<br>
&gt; &gt; ________________________________<br>
&gt; &gt;    /tmp/doc-exec-12/myfile.py:2:10: E201 whitespace after &#39;(&#39;<br>
&gt; &gt;    somefunc( 123,456)<br>
&gt; &gt;             ^<br>
&gt; &gt;    /tmp/doc-exec-12/myfile.py:2:14: E231 missing whitespace after &#39;,&#39;<br>
&gt; &gt;    somefunc( 123,456)<br>
&gt; &gt;                 ^<br>
&gt; &gt;<br>
&gt; &gt;    ========================= 1 failed in 0.01 seconds<br>
&gt; &gt; =========================<br>
&gt; &gt;<br>
&gt; &gt; Note that in the testing header you see the current list of default<br>
&gt; &gt; &quot;ignores&quot;.<br>
&gt; &gt; For the meaning of these error and warning codes, see the error output<br>
&gt; &gt; when running against your files or checkout `pep8.py<br>
&gt; &gt; &lt;<a href="https://github.com/jcrocholl/pep8/blob/master/pep8.py" target="_blank">https://github.com/jcrocholl/pep8/blob/master/pep8.py</a>&gt;`_.<br>
&gt; &gt;<br>
&gt; &gt; Configuring PEP8 options per-project<br>
&gt; &gt; ---------------------------------------------<br>
&gt; &gt;<br>
&gt; &gt; Lastly, you may configure PEP8-checking options for your project<br>
&gt; &gt; by adding an ``pep8options`` entry to your ``pytest.ini``<br>
&gt; &gt; or ``setup.cfg`` file like this::<br>
&gt; &gt;<br>
&gt; &gt;    [pytest]<br>
&gt; &gt;    pep8options = +W293 -E200<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Running PEP8 checks and no other tests<br>
&gt; &gt; ---------------------------------------------<br>
&gt; &gt;<br>
&gt; &gt; You can also restrict your test run to only perform &quot;pep8&quot; tests<br>
&gt; &gt; and not any other tests by typing::<br>
&gt; &gt;<br>
&gt; &gt;    py.test --pep8 -k pep8<br>
&gt; &gt;<br>
&gt; &gt; This will only run tests that are marked with the &quot;pep8&quot; keyword<br>
&gt; &gt; which is added for the pep8 test items added by this plugin.<br>
&gt; &gt;<br>
&gt; &gt; Notes<br>
&gt; &gt; -------------<br>
&gt; &gt;<br>
&gt; &gt; The repository of this plugin is at <a href="http://bitbucket.org/hpk42/pytest-pep8" target="_blank">http://bitbucket.org/hpk42/pytest-pep8</a><br>
&gt; &gt;<br>
&gt; &gt; For more info on py.test see <a href="http://pytest.org" target="_blank">http://pytest.org</a><br>
&gt; &gt;<br>
&gt; &gt; The code is partially based on Ronny Pfannschmidt&#39;s pytest-codecheckers<br>
&gt; &gt; plugin.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; testing-in-python mailing list<br>
&gt; &gt; <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt; &gt; <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
&gt; &gt;<br>
<br>
</div></div>--<br>
</blockquote></div><br>