fail2ban/fail2ban — pull request #181 by kwirk (2013-04-20 20:28:45+00:00)
Title: setup.py test

Bit of a big/messy and maybe controversial change to testing... :wink:
With python _distribute_ installed, you can now run tests from _setup.py_. This makes it easier to run tests on python3, as it does all the necessary _2to3_ conversions and adds the build directory to the path. It also picks up the `-v`/`--verbose` and `-q`/`--quiet` flags to change the log level of the tests.
_bin/fail2ban-testcases_ remains as it has ability to full trace-back, no network flag, regex test search and works with _fail2ban-testcases-all_ without worrying about the _distribute_ dependency.
One gotcha is that _fail2ban_ can't be imported within _setup.py_, as this breaks the python3 testing. Therefore `fail2ban.version` cannot be imported, so the version number has to be remembered to be changed before release.

To support this 4cc3a81 breaks out the _TZ_/`MyTime` "hack" to `fail2ban.test.utils`, and applies it `setUp`/`tearDown` elements of the tests that actually need it. Think this is worth pulling on its own if rest of pull request isn't accepted :smile: