This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients brett.cannon, ezio.melotti, pitrou, zach.ware
Date 2013-04-16.14:15:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1366121736.98.0.804326969812.issue17689@psf.upfronthosting.co.za>
In-reply-to
Content
> I found requires_bz2 and requires_lzma that already exist;

There's also requires_zlib.  import_module is also somewhat similar, but it's used to skip the whole test file when the module is missing.

> Here's another thought; would it be more useful to have a general
> version of this skip decorator in test.support

We were discussing this a couple of days ago on #python-dev.  Adding a skip_unless_module('modulename') (or requires_module('modulename')) and get rid of the several requires_* is certainly an option.

skip_unless_* (or requires_*) is shorter and more readable than skip_unless_module('modulename'), so this would be my preferred choice if it's defined and used within a single test module.  However if we add something to test.support, I'd rather have a more generic skip_unless_module('modulename') and get rid of the requires_*.
It's should also be possible to define specific ``skip_unless_x = skip_unless_module('x')`` in the test modules if necessary.

> should I just add a requires_gzip to test.support and use those three
> in test_tarfile?

I think that's reasonable for now -- we can always refactor it later and replace them with a skip_unless_module()
History
Date User Action Args
2013-04-16 14:15:37ezio.melottisetrecipients: + ezio.melotti, brett.cannon, pitrou, zach.ware
2013-04-16 14:15:36ezio.melottisetmessageid: <1366121736.98.0.804326969812.issue17689@psf.upfronthosting.co.za>
2013-04-16 14:15:36ezio.melottilinkissue17689 messages
2013-04-16 14:15:36ezio.melotticreate