Hi Jan, I just spent the last weekend learning about testing in pylons and using fixtures. As there are so many different packages involved it took me a while to understand it and I had questions similar to yours. But after two days of reading I think I got the basics now. So, hopefully my reply below makes sense and is correct :-)
On Apr 19, 7:22 am, Jan Koprowski <[email protected]> wrote: > When I'am looking for fixtures informations I found this > solution:http://farmdev.com/projects/fixture/ > This is pretty good and enough for me. There is only one problem. > Anyfixturedata is load and drop to/from database before,after each test. > This is terrible time-consuming. Two questions: > 1) Is there any solution to load data before test and drop after once > at all test process Have you had a look at the nosetest documentation? [1] There are several hooks described that allow defining set-up and tear-down methods that do not run on every test. I think, it is possible to define a setUp method in tests/__init__.py that is then only run once. > 2) Pylons still use paster.fixture- is there any plan to change this > tofixturefromfarmdev? Paste.fixture and farmdev fixture do different things. While farmdev fixture manages a database for testing, paste.fixture provides a wsgi or script environment to run tests and does not care about the database. It might be a bit confusing (at least it was for me!) that both modules are called fixture although they do completely different things. However, according to wikipedia a fixture describes a fixed environment for testing in general and not only in databases. To complicate things further paste.fixed is being reorganised at the moment and split into two separate modules called WebTest and ScriptTest (the link in the documentation is labeled "ScriptType"). WebTest contains the wsgi test environment and Script test the script testing environment. I my opinion it would be very nice if farmdev fixture would be included in pylons as well. Cheers, Christoph [1] http://somethingaboutorange.com/mrl/projects/nose/0.11.1/writing_tests.html#fixtures > Greetings from Poland > -- > Jan Koprowski --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
