[TIP] mark tests

Julian Berman julian at grayvines.com
Thu Jul 12 09:23:37 PDT 2012


The unittest skipIf decorators are the simplest things for skipping
individual tests / test cases. You could also group them and skip entire
platform specific modules.
On Jul 12, 2012 12:09 PM, "andrea crotti" <andrea.crotti.0 at gmail.com> wrote:

> 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?
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20120712/0d8e79a5/attachment.html>


More information about the testing-in-python mailing list