Pylons/Kotti — pull request #101 by witsch (2012-07-13 13:21:34+00:00)
Title: Refactor test setup to use pytest's funcargs

This add a [pytest](http://pytest.org/)-style test setup provided several [function arguments](http://pytest.org/latest/funcargs.html) for use in test method signatures:

* ``config``: the application configurator
* ``db_session``: a database session that rolls back changes after each test
* ``request``: a request object available via ``get_current_request``
* ``events``: trigger for inclusion of ``kotti.events``

The automatic database rollbacks inbetween tests allow to initialize and populate the database just once per test session. This brings the (local) test execution time down as follows:

* 35 vs. 53 seconds when testing against SQLite using 1 core (i.e. without ``-n4``)
* 24 vs. 32 seconds when testing against SQLite using 4 cores (i.e. with ``-n4``)
* 39 vs. 70 seconds when testing against PostgreSQL

All tests are passing, of course, except when running PostgreSQL tests using ``-n4``, but that's the same on current 'master'.

Please also note that not all tests have been converted to use the new setup yet. In other words, there is more potential performance-wise. Imho, it would still make sense to already merge this in order to avoid unnecessary conflicts with mainstream development on 'master'.