mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +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
1 changed files with 3 additions and 8 deletions
|
@ -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…
Add table
Reference in a new issue