Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory
python-dbus-deviation
correct-test-assertion-methods.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File correct-test-assertion-methods.patch of Package python-dbus-deviation
From 2ee6b32cc893eeda74a67593efc80f603b74a73c Mon Sep 17 00:00:00 2001 From: Steve Kowalik <steven@wedontsleep.org> Date: Mon, 22 Jan 2024 12:41:49 +1100 Subject: [PATCH] Use self.assertEqual() everywhere self.assertEquals() has been deprecated since 3.1 and was finally removed in Python 3.12. Move with the times and use the correct method name. --- dbusapi/tests/test_ast.py | 6 +++--- dbusapi/tests/test_interfaceparser.py | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dbusapi/tests/test_ast.py b/dbusapi/tests/test_ast.py index 70979ea..462bb90 100755 --- a/dbusapi/tests/test_ast.py +++ b/dbusapi/tests/test_ast.py @@ -227,9 +227,9 @@ def test_walk(self): }) children = [node for node in iface.walk()] - self.assertEquals(len(children), 2) - self.assertEquals(children[0], method) - self.assertEquals(children[1], annotation) + self.assertEqual(len(children), 2) + self.assertEqual(children[0], method) + self.assertEqual(children[1], annotation) class TestAstSignatures(unittest.TestCase): diff --git a/dbusapi/tests/test_interfaceparser.py b/dbusapi/tests/test_interfaceparser.py index 1902534..09d54ec 100755 --- a/dbusapi/tests/test_interfaceparser.py +++ b/dbusapi/tests/test_interfaceparser.py @@ -459,13 +459,13 @@ def test_doc_comments(self): (parser, interfaces, _) = _test_parser(xml) interface = interfaces.get('I.I') self.assertIsNotNone(interface) - self.assertEquals(interface.comment, "Please consider me") + self.assertEqual(interface.comment, "Please consider me") meth = interface.methods.get('foo') self.assertIsNotNone(meth) - self.assertEquals(meth.comment, "Notice me too") - self.assertEquals(len(meth.arguments), 1) + self.assertEqual(meth.comment, "Notice me too") + self.assertEqual(len(meth.arguments), 1) arg = meth.arguments[0] - self.assertEquals(arg.comment, "And me!") + self.assertEqual(arg.comment, "And me!") def test_line_numbers(self): """Test that line numbers are correctly computed""" @@ -498,7 +498,7 @@ def test_line_numbers(self): self.assertIsNotNone(meth) self.assertEqual(meth.line_number, 9) self.assertEqual(meth.comment_line_number, 6) - self.assertEquals(len(meth.arguments), 2) + self.assertEqual(len(meth.arguments), 2) arg = meth.arguments[0] self.assertEqual(arg.line_number, 13) self.assertEqual(arg.comment_line_number, 10) @@ -517,7 +517,7 @@ def test_doc_annotations(self): (parser, interfaces, _) = _test_parser(xml) interface = interfaces.get('I.I') self.assertIsNotNone(interface) - self.assertEquals(interface.comment, "bla") + self.assertEqual(interface.comment, "bla") def test_multiline_comments(self): xml = ("<node xmlns:tp='" @@ -534,9 +534,9 @@ def test_multiline_comments(self): (parser, interfaces, _) = _test_parser(xml) interface = interfaces.get('I.I') self.assertIsNotNone(interface) - self.assertEquals(interface.comment, - " Please consider that\n" - " multiline comment") + self.assertEqual(interface.comment, + " Please consider that\n" + " multiline comment") def test_ignored_comments(self): xml = ("<node xmlns:tp='"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor