mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Skip utils_test if timelib is not installed (#32699)
date_cast() throws a RuntimeError, not an ImportError
This commit is contained in:
parent
d1d806f893
commit
29814f9d43
@ -527,14 +527,9 @@ class UtilsTestCase(TestCase):
|
||||
ret = utils.date_cast('Mon Dec 23 10:19:15 MST 2013')
|
||||
expected_ret = datetime.datetime(2013, 12, 23, 10, 19, 15)
|
||||
self.assertEqual(ret, expected_ret)
|
||||
except ImportError:
|
||||
try:
|
||||
ret = utils.date_cast('Mon Dec 23 10:19:15 MST 2013')
|
||||
expected_ret = datetime.datetime(2013, 12, 23, 10, 19, 15)
|
||||
self.assertEqual(ret, expected_ret)
|
||||
except RuntimeError:
|
||||
# Unparseable without timelib installed
|
||||
self.skipTest('\'timelib\' is not installed')
|
||||
except RuntimeError:
|
||||
# Unparseable without timelib installed
|
||||
self.skipTest('\'timelib\' is not installed')
|
||||
|
||||
@skipIf(not HAS_TIMELIB, '\'timelib\' is not installed')
|
||||
def test_date_format(self):
|
||||
|
Loading…
Reference in New Issue
Block a user