From 157b1cb1a38207d0b9b1b53d66ab7beb029fe1e2 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 29 Oct 2024 10:38:05 +0000 Subject: [PATCH] test: replace more deprecated assertEquals `TestCase.assertEquals` was deprecated and removed in Python 3.12. Similar to #350, but for code that was added later. --- changelogs/fragments/406-python3.12.yml | 3 +++ .../modules/grafana/grafana_silence/test_grafana_silence.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/406-python3.12.yml diff --git a/changelogs/fragments/406-python3.12.yml b/changelogs/fragments/406-python3.12.yml new file mode 100644 index 00000000..376cc7a1 --- /dev/null +++ b/changelogs/fragments/406-python3.12.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - "test: replace more deprecated `TestCase.assertEquals` to support Python 3.12" diff --git a/tests/unit/modules/grafana/grafana_silence/test_grafana_silence.py b/tests/unit/modules/grafana/grafana_silence/test_grafana_silence.py index c2bb1df3..6ce81624 100644 --- a/tests/unit/modules/grafana/grafana_silence/test_grafana_silence.py +++ b/tests/unit/modules/grafana/grafana_silence/test_grafana_silence.py @@ -162,7 +162,7 @@ def test_create_silence_new_silence( }, method="POST", ) - self.assertEquals(result, {"silenceID": "470b7116-8f06-4bb6-9e6c-6258aa92218e"}) + self.assertEqual(result, {"silenceID": "470b7116-8f06-4bb6-9e6c-6258aa92218e"}) @patch( "ansible_collections.community.grafana.plugins.modules.grafana_silence.GrafanaSilenceInterface.get_version" @@ -208,4 +208,4 @@ def test_delete_silence(self, mock_fetch_url, mock_get_version): }, method="DELETE", ) - self.assertEquals(result, {"message": "silence deleted"}) + self.assertEqual(result, {"message": "silence deleted"})