From: Tomas Babej Date: Sun, 22 Mar 2015 14:50:12 +0000 (+0100) Subject: tests: Skip filtering by string datetime test for TW < 2.4.0 X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/f7c148ec05f006b3385e26017940604ffe9cb7ce?ds=inline tests: Skip filtering by string datetime test for TW < 2.4.0 --- diff --git a/tasklib/tests.py b/tasklib/tests.py index f1247af..b740c0d 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -851,6 +851,14 @@ class DatetimeStringTest(TasklibTest): self.assertEqual(due_date, t['due']) def test_filtering_with_string_datetime(self): + if self.tw.version < six.text_type('2.4.0'): + # Python2.6 does not support SkipTest. As a workaround + # mark the test as passed by exiting. + if getattr(unittest, 'SkipTest', None) is not None: + raise unittest.SkipTest() + else: + return + t = Task(self.tw, description="test task", due=datetime.datetime.now() - datetime.timedelta(0,2)) t.save()