From 9ee183c4b9155a37176470366a0511c9b169a4c5 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 10 Aug 2022 14:41:52 -0700 Subject: [PATCH] Clean up unit tests. (#78498) --- test/units/errors/test_errors.py | 4 ++-- test/units/executor/test_play_iterator.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/units/errors/test_errors.py b/test/units/errors/test_errors.py index 005be29e88c..7a1de3dd9e9 100644 --- a/test/units/errors/test_errors.py +++ b/test/units/errors/test_errors.py @@ -37,12 +37,12 @@ class TestErrors(unittest.TestCase): def test_basic_error(self): e = AnsibleError(self.message) self.assertEqual(e.message, self.message) - self.assertEqual(e.__repr__(), self.message) + self.assertEqual(repr(e), self.message) def test_basic_unicode_error(self): e = AnsibleError(self.unicode_message) self.assertEqual(e.message, self.unicode_message) - self.assertEqual(e.__repr__(), self.unicode_message) + self.assertEqual(repr(e), self.unicode_message) @patch.object(AnsibleError, '_get_error_lines_from_file') def test_error_with_kv(self, mock_method): diff --git a/test/units/executor/test_play_iterator.py b/test/units/executor/test_play_iterator.py index 386a76e28cc..6670888eaf9 100644 --- a/test/units/executor/test_play_iterator.py +++ b/test/units/executor/test_play_iterator.py @@ -37,11 +37,11 @@ class TestPlayIterator(unittest.TestCase): hs.tasks_child_state = HostState(blocks=[0]) hs.rescue_child_state = HostState(blocks=[1]) hs.always_child_state = HostState(blocks=[2]) - hs.__repr__() + repr(hs) hs.run_state = 100 - hs.__repr__() + repr(hs) hs.fail_state = 15 - hs.__repr__() + repr(hs) for i in range(0, 10): hs.cur_block = i