mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +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
d1b9a4061e
commit
5977f1f54c
@ -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