Fix unit test serialization (#86163)

This allows the test to work on pytest 9+
This commit is contained in:
Matt Clay
2025-11-10 16:29:20 -08:00
committed by GitHub
parent 89ba882b08
commit 76f07034b3

View File

@@ -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):