]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa: replace deprecated assertEquals
authorAdrian Freihofer <adrian.freihofer@gmail.com>
Thu, 8 Feb 2024 08:27:28 +0000 (09:27 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Feb 2024 23:14:49 +0000 (23:14 +0000)
assertEquals is deprecated since Python 2.7:
https://docs.python.org/2/library/unittest.html#deprecated-aliases
It throws errors at least on Python 3.12. Replace it by assertEqual.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/sdk/buildtools-cases/sanity.py
meta/lib/oeqa/selftest/cases/devtool.py
meta/lib/oeqa/selftest/cases/liboe.py

index b9dfa39a061de122c0f37bde4acac924462f9c82..a55d456656e24e8ed30363acf248445d105e1a2d 100644 (file)
@@ -21,4 +21,4 @@ class SanityTests(OESDKTestCase):
             # Canonicalise the location of this command
             tool_path = os.path.realpath(self._run("command -v %s" % command).strip())
             # Assert that the tool was found inside the SDK root
-            self.assertEquals(os.path.commonprefix((sdk_base, tool_path)), sdk_base)
+            self.assertEqual(os.path.commonprefix((sdk_base, tool_path)), sdk_base)
index 15249b70fdda91fa34705928e19291cd6ece9e7d..dd3a5e9b5c3f3406d6ae1eeeca2a602deda8d32e 100644 (file)
@@ -1097,7 +1097,7 @@ class DevtoolModifyTests(DevtoolBase):
             runCmd('git -C %s checkout %s' % (tempdir, branch))
             with open(source, "rt") as f:
                 content = f.read()
-            self.assertEquals(content, expected)
+            self.assertEqual(content, expected)
         if self.td["MACHINE"] == "qemux86":
             check('devtool', 'This is a test for qemux86\n')
         elif self.td["MACHINE"] == "qemuarm":
index fab6929198167182bccf8b142367c2e2ba7bc8e6..d5ffffdcb4123c5b817b1209f54ca64fdc03fcdf 100644 (file)
@@ -99,6 +99,6 @@ class LibOE(OESelftestTestCase):
 
         dstcnt = len(os.listdir(dst))
         srccnt = len(os.listdir(src))
-        self.assertEquals(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt))
+        self.assertEqual(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt))
 
         oe.path.remove(testloc)