support/testing: add python-cloudpickle tests
commit: https://gitlab.com/buildroot.org/buildroot/-/commit/d25f18a3c3bc984df529cf2b264be2fe30b51257
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/master
Add a basic runtime test for the python-cloudpickle package. This test verifies the fundamental serialization capabilities of the library by:
- Importing cloudpickle.
- Defining a simple Python function (fibonacci).
- Using cloudpickle.dumps() to serialize this function.
Signed-off-by Xukai Wang <[email protected]>
[Julien: fix flake8 warnings to fix check-package errors]
Signed-off-by Julien Olivain <[email protected]>
--- DEVELOPERS | 2 ++ support/testing/tests/package/sample_python_cloudpickle.py | 8 ++++++++ support/testing/tests/package/test_python_cloudpickle.py | 12 ++++++++++++ 3 files changed, 22 insertions(+)
DEVELOPERS +2 -0
@@ -3483,6 +3483,8 @@ N: Xukai Wang <[email protected]> F: package/python-cloudpickle/ F: package/python-farama-notifications/ F: package/python-gymnasium/ +F: support/testing/tests/package/sample_python_cloudpickle.py +F: support/testing/tests/package/test_python_cloudpickle.py N: Yair Ben Avraham <[email protected]> F: package/casync/
support/testing/tests/package/sample_python_cloudpickle.py new file +8 -0
@@ -0,0 +1,8 @@ +import cloudpickle + + +def fibonacci(n): + return n if n < 2 else fibonacci(n-1) + fibonacci(n-2) + + +serialized = cloudpickle.dumps(fibonacci)
support/testing/tests/package/test_python_cloudpickle.py new file +12 -0
@@ -0,0 +1,12 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3Cloudpickle(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_CLOUDPICKLE=y + """ + sample_scripts = ["tests/package/sample_python_cloudpickle.py"] + timeout = 20
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot