Skip to content

Commit

Permalink
test: replace more deprecated assertEquals
Browse files Browse the repository at this point in the history
`TestCase.assertEquals` was deprecated and removed in Python 3.12.

Similar to #350, but for code that was added later.
  • Loading branch information
cjwatson committed Oct 29, 2024
1 parent 72d5c1b commit a1789ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/406-python3.12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "test: replace more deprecated `TestCase.assertEquals` to support Python 3.12"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"})

0 comments on commit a1789ff

Please sign in to comment.