<div dir="ltr"><div>I find it really helps TDD to have my tests run automatically whenever I change either a test or the code itself. I set my editor (Sublime Text 3) to auto save upon defocus, so it's actually impossible to avoid a test rerun whenever I alter a file and move on or hit save.</div><div><br></div><div>For this, I regularly use Jonathan Hartley's rerun Python library[0] which gives the ability to wrap my py.test or tox command like so:</div><div><br></div><div>rerun --ignore sqlite.db "py.test tests/"</div><div><br></div><div>The --ignore part is very important, as different test suites end up altering various working directory files, and if you can't select files/folders (file patterns would be even better) to ignore, you end up in an un-pausing loop of test reruns.</div><div><br></div><div>I hadn't heard of looponchange can it ignore certain files/folders?</div><div><br></div><div>[0] <a href="https://pypi.python.org/pypi/rerun">https://pypi.python.org/pypi/rerun</a></div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 27 Mar 2015 14:55:31 +0000<br>
From: Tibor Arpas <<a href="mailto:tibor.arpas@infinit.sk">tibor.arpas@infinit.sk</a>><br>
To: "<a href="mailto:pytest-dev@python.org">pytest-dev@python.org</a>" <<a href="mailto:pytest-dev@python.org">pytest-dev@python.org</a>><br>
Subject: [pytest-dev] re-running pytest on file changes<br>
Message-ID:<br>
        <<a href="mailto:CADi_WY3cbDAOfDS8%2BoV5iRoF6qzvjsX%2B_PSmcBK-Ss1uObGCxA@mail.gmail.com">CADi_WY3cbDAOfDS8+oV5iRoF6qzvjsX+_PSmcBK-Ss1uObGCxA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi,<br>
<br>
I'm trying to wrap my head around this subject.<br>
<br>
Is there a strong reason why the -f looponfail option is inside a plug-in?<br>
My hunch would be to do it as a separate, flexible, command, but that's<br>
just feelings without any experience.<br>
<br>
Poll: Do you guys use looponfail? Has it been working good? Does it play<br>
nice with other tasks you might want to do on file changes? What other<br>
tools do you use for repeated tasks on source code changes?<br>
<br>
What's the situation at the moment with --looponfail and --looponchange? Is<br>
it going to be inside pytest_cache which will go into core? Or it will be a<br>
different plug-in?<br>
<br>
I've seen<br>
<a href="https://bitbucket.org/pytest-dev/pytest/commits/b5727cc6632c/" target="_blank">https://bitbucket.org/pytest-dev/pytest/commits/b5727cc6632c/</a><br>
<br>
and the "take in cache" PR.<br>
<br>
<br>
Tibor<br>
P.S. some more thoughts about the same functionality are here:<br>
<a href="https://github.com/tarpas/testmon/issues/4" target="_blank">https://github.com/tarpas/testmon/issues/4</a><br>
and a script whith callbacks for every success and failure:<br>
<a href="https://github.com/blueyed/testmon/blob/tmon-improvements/testmon/tmon.py" target="_blank">https://github.com/blueyed/testmon/blob/tmon-improvements/testmon/tmon.py</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.python.org/pipermail/pytest-dev/attachments/20150327/a09d699c/attachment-0001.html" target="_blank">http://mail.python.org/pipermail/pytest-dev/attachments/20150327/a09d699c/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
pytest-dev mailing list<br>
<a href="mailto:pytest-dev@python.org">pytest-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pytest-dev" target="_blank">https://mail.python.org/mailman/listinfo/pytest-dev</a><br>
<br>
<br>
------------------------------<br>
<br>
End of pytest-dev Digest, Vol 28, Issue 22<br>
******************************************<br>
</blockquote></div><br></div></div>