[py-dev] Thanks a lot for py.test!
holger krekel
hpk at trillke.net
Sat Oct 22 21:01:24 CEST 2005
Hi François!
On Sun, Oct 16, 2005 at 10:15 -0400, Fran?ois Pinard wrote:
> Hi, people. I just wanted to share my enthusiasm for py.test.
much appreciated :-)
> In a relatively short amount of time, I wrote a lot of tests (1122 so
> far) for the big project keeping me busy in these days. With careful
> thinking and much using generators, it is very easy to lie tests down
> cleanly and quickly, in a progressive way, just as a way to crystallise
> my understanding of the project as it develops, making it more solid.
Sounds good.
> For a few cases, test functions are more convenient and leaner than test
> methods, while in other cases, it is more natural grouping tests within
> test classes. Whenever needed, setup and teardown helpers are sometimes
> better written at module level, sometimes at class level (I had not
> use for method level so far). As I test on different machines and
> locations, the disabling feature is rather useful to cope with various
> limitations, like firewalls and such. When I have some need to express,
> py.test offers a nice, simple, clean, fast way. It's pure pleasure! :-)
hehe. Actually we should also think about how to allow disabling tests
at module level or even at directoy level, i guess. OTOH, there
is the long standing idea of properly connecting tags/keywords
to tests on directory, module and class level (these would all apply
to groups of test) and directly on a test function. Implementing
this as static tags should be rather straight forward.
On a more far fetched note, dynamic tags could be assigned to test
functions unintrusively, e.g. assigning "speed" tags like
"slow/bearable/fast". Such "dynamic tags" could be assigned
during a regular test run along with "failed" or "skipped"
information. This way one could run all previously failing
tests without having to use "--looponfailing". The main
missing piece to implement this nicely is a concept
to store such state.
> And I did not even study nor use the parts of the documentation about
> implementation or customization -- maybe I'm not sophisticated enough
> yet for needing them :-) -- but in any case, it leaves me with the good
> feeling that there is loose power available if I ever need more.
Yes, although that area could need some clarifications and refinements.
When it comes to "conftest.py" files there is a lot that you can do,
basically take over test collecting and running in subdirectories
which is what is done for ReST or for PyPy.
> All in all, it seems that one can do lots, by using nothing more than
> the simpler parts of py.test. It's much comforting. Thanks, gang!
hehe, many thanks for your feedback! might make it to the
web page some time, if you don't mind :-)
cheers,
holger
More information about the Pytest-dev
mailing list