<br><br><div class="gmail_quote">On Mon, Dec 6, 2010 at 9:50 AM, holger krekel <span dir="ltr"><<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>></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>
> On Mon, Dec 6, 2010 at 8:46 AM, holger krekel <<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>> wrote:<br>
><br>
> ><br>
> > just released an initial version 0.6 of the pytest-pep8 plugin,<br>
> > integrating the ``pep8`` module into py.test runs, allowing full<br>
> > per-project customization and configuration.<br>
> ><br>
> ><br>
> This looks very useful as py.test plugin.<br>
><br>
> Is there any way of getting junit output from it? This would help when using<br>
> it with Hudson.<br>
><br>
> We already use the junit flag to output test results but wanted to add<br>
> something like the pep8 plugin<br>
> for correctness :)<br>
<br>
</div>Heh, <borrowing-time-machine> 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'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 "extras" 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>"ON" 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>
><br>
><br>
><br>
> > See <a href="http://pypi.python.org/pypi/pytest-pep8" target="_blank">http://pypi.python.org/pypi/pytest-pep8</a> for installation<br>
> > and configuration instructions.<br>
> ><br>
> > best,<br>
> > holger<br>
> ><br>
> > Usage<br>
> > -----------------<br>
> ><br>
> > install pytest-pep8 via::<br>
> ><br>
> > easy_install pytest-pep8 # or<br>
> > pip install pytest-pep8<br>
> ><br>
> > and then type::<br>
> ><br>
> > py.test --pep8<br>
> ><br>
> > to activate source code checking. Every file ending in ``.py`` will be<br>
> > discovered and checked, starting from the command line arguments.<br>
> > For example, if you have a file like this::<br>
> ><br>
> > # content of myfile.py<br>
> ><br>
> > somefunc( 123,456)<br>
> ><br>
> > you can run it with::<br>
> ><br>
> > $ py.test --pep8<br>
> > =========================== test session starts<br>
> > ============================<br>
> > platform linux2 -- Python 2.6.5 -- pytest-2.0.1.dev1<br>
> > pep8 ignore opts: E202 E221 E222 E241 E301 E302 E401 E501 E701 W293 W391<br>
> > W601 W602<br>
> > collecting ... collected 1 items<br>
> ><br>
> > myfile.py F<br>
> ><br>
> > ================================= FAILURES<br>
> > =================================<br>
> > ________________________________ PEP8-check<br>
> > ________________________________<br>
> > /tmp/doc-exec-12/myfile.py:2:10: E201 whitespace after '('<br>
> > somefunc( 123,456)<br>
> > ^<br>
> > /tmp/doc-exec-12/myfile.py:2:14: E231 missing whitespace after ','<br>
> > somefunc( 123,456)<br>
> > ^<br>
> ><br>
> > ========================= 1 failed in 0.01 seconds<br>
> > =========================<br>
> ><br>
> > Note that in the testing header you see the current list of default<br>
> > "ignores".<br>
> > For the meaning of these error and warning codes, see the error output<br>
> > when running against your files or checkout `pep8.py<br>
> > <<a href="https://github.com/jcrocholl/pep8/blob/master/pep8.py" target="_blank">https://github.com/jcrocholl/pep8/blob/master/pep8.py</a>>`_.<br>
> ><br>
> > Configuring PEP8 options per-project<br>
> > ---------------------------------------------<br>
> ><br>
> > Lastly, you may configure PEP8-checking options for your project<br>
> > by adding an ``pep8options`` entry to your ``pytest.ini``<br>
> > or ``setup.cfg`` file like this::<br>
> ><br>
> > [pytest]<br>
> > pep8options = +W293 -E200<br>
> ><br>
> ><br>
> > Running PEP8 checks and no other tests<br>
> > ---------------------------------------------<br>
> ><br>
> > You can also restrict your test run to only perform "pep8" tests<br>
> > and not any other tests by typing::<br>
> ><br>
> > py.test --pep8 -k pep8<br>
> ><br>
> > This will only run tests that are marked with the "pep8" keyword<br>
> > which is added for the pep8 test items added by this plugin.<br>
> ><br>
> > Notes<br>
> > -------------<br>
> ><br>
> > 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>
> ><br>
> > For more info on py.test see <a href="http://pytest.org" target="_blank">http://pytest.org</a><br>
> ><br>
> > The code is partially based on Ronny Pfannschmidt's pytest-codecheckers<br>
> > plugin.<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > testing-in-python mailing list<br>
> > <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
> > <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
> ><br>
<br>
</div></div>--<br>
</blockquote></div><br>