On Tue, 20 Dec 2011 14:33:37 +0100, Ulrich Eckhardt wrote:

> Hi!
> 
> I'd like to give my users a meaningful error message when they are using
> obsolete Python versions. Is there some kind of best practice or recipe
> for that? Specifically, the case is a bunch of unittests that use
> features new to Python 2.7.

if sys.version < "2.7": ...


Or test for features and either provide your own, or disable 
functionality not available:

class MyTest:
    try:
        @unittest.FancyFeature
        def testFancy(self):
            self.assertFancy(self, ...)
    except AttributeError:
        pass
    


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to