diff options
author | Tim Orling <timothy.t.orling@intel.com> | 2021-06-18 12:05:47 -0700 |
---|---|---|
committer | Tim Orling <timothy.t.orling@intel.com> | 2021-06-21 08:33:46 -0700 |
commit | 98378ccfd3108986e15fa3d4fc92dc9501fa4581 (patch) | |
tree | 407ff5115d4b693f3cb1f09cbb59c8a0b87f9f80 | |
parent | a8d20250c1776378d13920008a004668bc2f5cf9 (diff) | |
download | openembedded-core-contrib-98378ccfd3108986e15fa3d4fc92dc9501fa4581.tar.gz |
python3: skip tests requiring tools-sdk
Conditionally skip test_ctypes.test_find unless
IMAGE_FEATURES contains 'tools-sdk' as these test
cases require full packagegroup-core-buildessential
Fixes:
AssertionError: Failed ptests:
{'python3': ['test_find_library_with_gcc', 'test_find_library_with_ld']}
Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-test_ctypes.test_find-skip-without-tools-sdk.patch | 33 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.8.8.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-test_ctypes.test_find-skip-without-tools-sdk.patch b/meta/recipes-devtools/python/python3/0001-test_ctypes.test_find-skip-without-tools-sdk.patch new file mode 100644 index 0000000000..a44d3396a6 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-test_ctypes.test_find-skip-without-tools-sdk.patch @@ -0,0 +1,33 @@ +From 7a2bddfa437be633bb6945d0e6b7d6f27da870ad Mon Sep 17 00:00:00 2001 +From: Tim Orling <timothy.t.orling@intel.com> +Date: Fri, 18 Jun 2021 11:56:50 -0700 +Subject: [PATCH] test_ctypes.test_find: skip without tools-sdk + +These tests need full packagegroup-core-buildessential, the +easiest way to dynamically check for that is looking for +'tools-sdk' in IMAGE_FEATURES. + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Tim Orling <timothy.t.orling@intel.com> +--- + Lib/ctypes/test/test_find.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py +index 92ac184..0d009d1 100644 +--- a/Lib/ctypes/test/test_find.py ++++ b/Lib/ctypes/test/test_find.py +@@ -112,10 +112,12 @@ class FindLibraryLinux(unittest.TestCase): + # LD_LIBRARY_PATH) + self.assertEqual(find_library(libname), 'lib%s.so' % libname) + ++ @unittest.skip("Needs IMAGE_FEATURES += \"tools-sdk\"") + def test_find_library_with_gcc(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None): + self.assertNotEqual(find_library('c'), None) + ++ @unittest.skip("Needs IMAGE_FEATURES += \"tools-sdk\"") + def test_find_library_with_ld(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \ + unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None): diff --git a/meta/recipes-devtools/python/python3_3.8.8.bb b/meta/recipes-devtools/python/python3_3.8.8.bb index d77c7d87fb..0febe6b672 100644 --- a/meta/recipes-devtools/python/python3_3.8.8.bb +++ b/meta/recipes-devtools/python/python3_3.8.8.bb @@ -33,6 +33,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-configure.ac-fix-LIBPL.patch \ file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \ file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \ + ${@bb.utils.contains('IMAGE_FEATURES', 'tools-sdk', '', 'file://0001-test_ctypes.test_find-skip-without-tools-sdk.patch', d)} \ " SRC_URI_append_class-native = " \ |