[TIP] unittest.TestCase and tags

Mateusz Łoskot mateusz at loskot.net
Fri Apr 18 05:31:32 PDT 2014


I have a collection of integration tests based on the unittest package.
I'd like to be able to categorise tests, so I can select what kind of tests
I want to run. For example, tests reaching local filesystem,
tests relying on remote database servers, and so on.

I found similar question has been asked in 2008 in thread
"Tag-based execution plugin for nose?" [1] but the solution
is based on extending unittest with metaclass [2] to enable use of nose.

Is nose the only way to achieve such extensible tagging for unittest cases?
Is the solution proposed above still recommended option or perhaps
the unittest has got some related features in Python 3.2 or later?
Any other mechanisms of tagging out there?

[1] http://lists.idyll.org/pipermail/testing-in-python/2008-June/000731.html
[2] http://lists.idyll.org/pipermail/testing-in-python/2008-June/000733.html

Best regards,
Mateusz  Łoskot, http://mateusz.loskot.net

More information about the testing-in-python mailing list