[stable-2.18] Fix unit test serialization (#86163) (#86166)

This allows the test to work on pytest 9+

(cherry picked from commit 76f07034b3)
pull/86193/head
Matt Clay 2 months ago committed by GitHub
parent 8e8cf05703
commit ccf8754bc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -102,16 +102,16 @@ class TestTask(unittest.TestCase):
self.assertEqual(t.get_validated_value('delay', t.fattributes.get('delay'), delay, None), expected)
bad_params = [
('E', ValueError),
('1.E', ValueError),
('E.1', ValueError),
'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(self._task_base)
t = Task().load_data(p)
with self.assertRaises(expected):
with self.assertRaises(ValueError):
dummy = t.get_validated_value('delay', t.fattributes.get('delay'), delay, None)
def test_task_auto_name_with_role(self):

Loading…
Cancel
Save