[PR #7348/6c9713b3 backport][stable-7] Fix Python 3.12 unit tests (#7351)

Fix Python 3.12 unit tests (#7348)

* Re-enable Python 3.12 unit tests.

* Stop using deprecated alias.

* Stop using long deprecated subset comparison function.

* Avoid another alias.

* Fix name, add Python 2 compatibility.

* Properly make backwards compatible.

(cherry picked from commit 6c9713b36c)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot]
2023-10-05 06:36:50 +02:00
committed by GitHub
parent 551e5e4bd5
commit 3cb9b0fa91
9 changed files with 55 additions and 41 deletions

View File

@@ -140,7 +140,7 @@ class TestJenkinsBuildInfo(unittest.TestCase):
self.assertFalse(return_json.exception.args[0]['changed'])
self.assertTrue(return_json.exception.args[0]['failed'])
self.assertEquals("ABSENT", return_json.exception.args[0]['build_info']['result'])
self.assertEqual("ABSENT", return_json.exception.args[0]['build_info']['result'])
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.test_dependencies')
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.JenkinsBuildInfo.get_jenkins_connection')
@@ -157,7 +157,7 @@ class TestJenkinsBuildInfo(unittest.TestCase):
jenkins_build_info.main()
self.assertFalse(return_json.exception.args[0]['changed'])
self.assertEquals("SUCCESS", return_json.exception.args[0]['build_info']['result'])
self.assertEqual("SUCCESS", return_json.exception.args[0]['build_info']['result'])
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.test_dependencies')
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.JenkinsBuildInfo.get_jenkins_connection')
@@ -177,4 +177,4 @@ class TestJenkinsBuildInfo(unittest.TestCase):
self.assertFalse(return_json.exception.args[0]['changed'])
self.assertTrue(return_json.exception.args[0]['failed'])
self.assertEquals("ABSENT", return_json.exception.args[0]['build_info']['result'])
self.assertEqual("ABSENT", return_json.exception.args[0]['build_info']['result'])