[py-dev] Little py.test patch

Antonio Cuni anto.cuni at gmail.com
Thu May 25 21:35:32 CEST 2006


Hi Holger,
I've written a little patch for py.test that implements a new feature.

Basically, I noticed that often I do the following code-and-test cycle, 
especially after a large refactoring:
   - edit the code
   - run all test with -x
   - correct the bug (ofter a stupid one, like a type)
   - restart the cycle

I don't like to run all tests without -x because often one small bug 
affects many tests, so I don't want to wait for them to be completed.

The problem with my approach is that when the failing tests are at the 
end of the queue I have to wait long before all previous tests (that I 
already know to pass) complete, so I wrote some code that let me to 
start from a specific test (identified by a number) and skip the ones 
that come before.

The command-line option to do this is '-n'; when a test fails its number 
is printed at the start of the traceback, just after the name, so we can 
easily restart from there.

I don't know how well written is the patch, because I know very little 
of py.test internals, it may seem just a quick hack, but it does the job.

Here is the diff against revision 26654, feel free to include in the 
repository.

ciao Anto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: py.test.diff
Type: text/x-patch
Size: 3124 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20060525/3c2dcb16/attachment.bin>


More information about the Pytest-dev mailing list