aboutsummaryrefslogtreecommitdiffstats
path: root/test/xmp.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/xmp.py')
-rw-r--r--test/xmp.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/xmp.py b/test/xmp.py
index ba5b0b6..70e0980 100644
--- a/test/xmp.py
+++ b/test/xmp.py
@@ -184,8 +184,13 @@ class TestXmpTag(unittest.TestCase):
self.failUnlessRaises(XmpValueError, tag._convert_to_string, 'invalid', 'Date')
self.failUnlessRaises(XmpValueError, tag._convert_to_string, None, 'Date')
- @unittest.skipIf(pytz is None, 'install python-tz to run this test')
def test_convert_to_string_date_with_real_timezones(self):
+ if pytz is None:
+ # Poor man’s test skipping. Starting with Python 2.7, decorators are
+ # available to implement this in a cleaner fashion
+ # (http://docs.python.org/library/unittest.html#unittest-skipping).
+ print 'Install python-tz to run this test. Skipping.'
+ return
tag = XmpTag('Xmp.xmp.CreateDate')
self.assertEqual(tag.type, 'Date')
t = pytz.timezone('UTC').localize(datetime.datetime(2011, 2, 2, 10, 52, 4))