summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2024-02-21 20:36:57 +0100
committerSteve Sakoman <steve@sakoman.com>2024-03-01 05:19:53 -1000
commit53705c1c84c7831a64ad00f173987bee27d1f090 (patch)
treef79d9eaa370ad4b080055b1e4c1c61ffff9d903a
parentda694d9d5867cb4c406768dcf0ee5ed4ff84b810 (diff)
downloadpoky-53705c1c84c7831a64ad00f173987bee27d1f090.tar.gz
oeqa: replace deprecated assertEquals
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. (From OE-Core rev: a20325690a057aa7f71e5a176bfbdc03baac405c) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 68286d0b70cf09a0d2950b48945c9192fb8c8769 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/oeqa/sdk/buildtools-cases/sanity.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/liboe.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py b/meta/lib/oeqa/sdk/buildtools-cases/sanity.py
index 64baaa8f84..68b19f4d47 100644
--- a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py
+++ b/meta/lib/oeqa/sdk/buildtools-cases/sanity.py
@@ -19,4 +19,4 @@ class SanityTests(OESDKTestCase):
19 # Canonicalise the location of this command 19 # Canonicalise the location of this command
20 tool_path = os.path.realpath(self._run("command -v %s" % command).strip()) 20 tool_path = os.path.realpath(self._run("command -v %s" % command).strip())
21 # Assert that the tool was found inside the SDK root 21 # Assert that the tool was found inside the SDK root
22 self.assertEquals(os.path.commonprefix((sdk_base, tool_path)), sdk_base) 22 self.assertEqual(os.path.commonprefix((sdk_base, tool_path)), sdk_base)
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index aea2ad6561..dc0fc35062 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -919,7 +919,7 @@ class DevtoolModifyTests(DevtoolBase):
919 runCmd('git -C %s checkout %s' % (tempdir, branch)) 919 runCmd('git -C %s checkout %s' % (tempdir, branch))
920 with open(source, "rt") as f: 920 with open(source, "rt") as f:
921 content = f.read() 921 content = f.read()
922 self.assertEquals(content, expected) 922 self.assertEqual(content, expected)
923 check('devtool', 'This is a test for something\n') 923 check('devtool', 'This is a test for something\n')
924 check('devtool-no-overrides', 'This is a test for something\n') 924 check('devtool-no-overrides', 'This is a test for something\n')
925 check('devtool-override-qemuarm', 'This is a test for qemuarm\n') 925 check('devtool-override-qemuarm', 'This is a test for qemuarm\n')
diff --git a/meta/lib/oeqa/selftest/cases/liboe.py b/meta/lib/oeqa/selftest/cases/liboe.py
index afe8f8809f..da88ff480e 100644
--- a/meta/lib/oeqa/selftest/cases/liboe.py
+++ b/meta/lib/oeqa/selftest/cases/liboe.py
@@ -97,6 +97,6 @@ class LibOE(OESelftestTestCase):
97 97
98 dstcnt = len(os.listdir(dst)) 98 dstcnt = len(os.listdir(dst))
99 srccnt = len(os.listdir(src)) 99 srccnt = len(os.listdir(src))
100 self.assertEquals(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt)) 100 self.assertEqual(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt))
101 101
102 oe.path.remove(testloc) 102 oe.path.remove(testloc)