[TIP] mark tests

andrea crotti andrea.crotti.0 at gmail.com
Thu Jul 12 09:08:10 PDT 2012


I'm writing a very complicated system that has to interact with
databases, filesystems and perforce.

I have a mock database using an in memory sqlite, and I'm studying some
other ways to manage the filesystem, but I also have some tests that use
the real db and real filesystem.

Now I would like to have a way to mark them, for example I might want to
run certain things only on Linux, other only on Windows, maybe on Linux
I want to use the real database, on Windows the fake one..

What might be a good way to achieve this (I use nosetest + mock + coverage)?

Subclassing unittest.TestCase?
Or maybe using decorators?
Any other ideas?



More information about the testing-in-python mailing list