diff options
| author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-08 09:27:28 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-08 23:14:51 +0000 |
| commit | f58aedff022e5ddd7c9855e3fa4e71040fd5ab1e (patch) | |
| tree | 9ae9d82bd5f70f9e83cb0417b90820a06b6c0fcc | |
| parent | 233d2d8c0d29fb7efbe278922b9fa0651fec87e9 (diff) | |
| download | poky-f58aedff022e5ddd7c9855e3fa4e71040fd5ab1e.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: 68286d0b70cf09a0d2950b48945c9192fb8c8769)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/sdk/buildtools-cases/sanity.py | 2 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 2 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/liboe.py | 2 |
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 b9dfa39a06..a55d456656 100644 --- a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py +++ b/meta/lib/oeqa/sdk/buildtools-cases/sanity.py | |||
| @@ -21,4 +21,4 @@ class SanityTests(OESDKTestCase): | |||
| 21 | # Canonicalise the location of this command | 21 | # Canonicalise the location of this command |
| 22 | tool_path = os.path.realpath(self._run("command -v %s" % command).strip()) | 22 | tool_path = os.path.realpath(self._run("command -v %s" % command).strip()) |
| 23 | # Assert that the tool was found inside the SDK root | 23 | # Assert that the tool was found inside the SDK root |
| 24 | self.assertEquals(os.path.commonprefix((sdk_base, tool_path)), sdk_base) | 24 | 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 15249b70fd..dd3a5e9b5c 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
| @@ -1097,7 +1097,7 @@ class DevtoolModifyTests(DevtoolBase): | |||
| 1097 | runCmd('git -C %s checkout %s' % (tempdir, branch)) | 1097 | runCmd('git -C %s checkout %s' % (tempdir, branch)) |
| 1098 | with open(source, "rt") as f: | 1098 | with open(source, "rt") as f: |
| 1099 | content = f.read() | 1099 | content = f.read() |
| 1100 | self.assertEquals(content, expected) | 1100 | self.assertEqual(content, expected) |
| 1101 | if self.td["MACHINE"] == "qemux86": | 1101 | if self.td["MACHINE"] == "qemux86": |
| 1102 | check('devtool', 'This is a test for qemux86\n') | 1102 | check('devtool', 'This is a test for qemux86\n') |
| 1103 | elif self.td["MACHINE"] == "qemuarm": | 1103 | elif self.td["MACHINE"] == "qemuarm": |
diff --git a/meta/lib/oeqa/selftest/cases/liboe.py b/meta/lib/oeqa/selftest/cases/liboe.py index fab6929198..d5ffffdcb4 100644 --- a/meta/lib/oeqa/selftest/cases/liboe.py +++ b/meta/lib/oeqa/selftest/cases/liboe.py | |||
| @@ -99,6 +99,6 @@ class LibOE(OESelftestTestCase): | |||
| 99 | 99 | ||
| 100 | dstcnt = len(os.listdir(dst)) | 100 | dstcnt = len(os.listdir(dst)) |
| 101 | srccnt = len(os.listdir(src)) | 101 | srccnt = len(os.listdir(src)) |
| 102 | self.assertEquals(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt)) | 102 | self.assertEqual(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt)) |
| 103 | 103 | ||
| 104 | oe.path.remove(testloc) | 104 | oe.path.remove(testloc) |
