mirror of
https://github.com/ansible/ansible.git
synced 2025-11-30 23:16:08 +07:00
Fix unit test serialization (#86163)
This allows the test to work on pytest 9+
This commit is contained in:
@@ -59,16 +59,16 @@ class TestTask(unittest.TestCase):
|
||||
self.assertEqual(t.get_validated_value('delay', t.fattributes.get('delay'), delay, None), expected)
|
||||
|
||||
bad_params = [
|
||||
('E', AnsibleError),
|
||||
('1.E', AnsibleError),
|
||||
('E.1', AnsibleError),
|
||||
'E',
|
||||
'1.E',
|
||||
'E.1',
|
||||
]
|
||||
for delay, expected in bad_params:
|
||||
with self.subTest(f'type "{type(delay)} was cast to float w/o error', delay=delay, expected=expected):
|
||||
for delay in bad_params:
|
||||
with self.subTest(f'type "{type(delay)} was cast to float w/o error', delay=delay):
|
||||
p = dict(delay=delay)
|
||||
p.update(task_base)
|
||||
t = Task().load_data(p)
|
||||
with self.assertRaises(expected):
|
||||
with self.assertRaises(AnsibleError):
|
||||
dummy = t.get_validated_value('delay', t.fattributes.get('delay'), delay, None)
|
||||
|
||||
def test_task_auto_name_with_role(self):
|
||||
|
||||
Reference in New Issue
Block a user