Message187082
> 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() |
|
Date |
User |
Action |
Args |
2013-04-16 14:15:37 | ezio.melotti | set | recipients:
+ ezio.melotti, brett.cannon, pitrou, zach.ware |
2013-04-16 14:15:36 | ezio.melotti | set | messageid: <1366121736.98.0.804326969812.issue17689@psf.upfronthosting.co.za> |
2013-04-16 14:15:36 | ezio.melotti | link | issue17689 messages |
2013-04-16 14:15:36 | ezio.melotti | create | |
|