[Buildroot] [PATCH 2/2] package/apscheduler: new runtime test
Marcus Hoffmann
buildroot at bubu1.eu
Sat May 17 12:14:08 UTC 2025
Signed-off-by: Marcus Hoffmann <buildroot at bubu1.eu>
---
DEVELOPERS | 2 ++
.../tests/package/sample_python_apscheduler.py | 15 +++++++++++++++
.../tests/package/test_python_apscheduler.py | 12 ++++++++++++
3 files changed, 29 insertions(+)
create mode 100644 support/testing/tests/package/sample_python_apscheduler.py
create mode 100644 support/testing/tests/package/test_python_apscheduler.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 454fea0f66..d16ea6148e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2284,12 +2284,14 @@ F: package/python-ruamel-yaml-clib/
F: package/python-typing-inspection/
F: package/python-tzlocal/
F: package/python-waitress/
+F: support/testing/tests/package/test_python_apscheduler.py
F: support/testing/tests/package/test_python_fastapi.py
F: support/testing/tests/package/test_python_pydantic.py
F: support/testing/tests/package/test_python_pydantic_settings.py
F: support/testing/tests/package/test_python_ruamel_yaml.py
F: support/testing/tests/package/test_python_tzlocal.py
F: support/testing/tests/package/test_python_waitress.py
+F: support/testing/tests/package/sample_python_apscheduler.py
F: support/testing/tests/package/sample_python_fastapi.py
F: support/testing/tests/package/sample_python_pydantic.py
F: support/testing/tests/package/sample_python_pydantic_settings.py
diff --git a/support/testing/tests/package/sample_python_apscheduler.py b/support/testing/tests/package/sample_python_apscheduler.py
new file mode 100644
index 0000000000..befe424c28
--- /dev/null
+++ b/support/testing/tests/package/sample_python_apscheduler.py
@@ -0,0 +1,15 @@
+from queue import Queue
+from apscheduler.schedulers.background import BackgroundScheduler
+
+queue = Queue()
+
+
+def work():
+ queue.put("Ping!")
+
+
+scheduler = BackgroundScheduler()
+scheduler.add_job(work, "interval", seconds=1)
+scheduler.start()
+result = queue.get(timeout=3)
+assert result == "Ping!"
diff --git a/support/testing/tests/package/test_python_apscheduler.py b/support/testing/tests/package/test_python_apscheduler.py
new file mode 100644
index 0000000000..19eb8c9b41
--- /dev/null
+++ b/support/testing/tests/package/test_python_apscheduler.py
@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Apscheduler(TestPythonPackageBase):
+ __test__ = True
+ config = TestPythonPackageBase.config + \
+ """
+ BR2_PACKAGE_PYTHON3=y
+ BR2_PACKAGE_PYTHON_APSCHEDULER=y
+ """
+ sample_scripts = ["tests/package/sample_python_apscheduler.py"]
+ timeout = 15
--
2.43.0
More information about the buildroot
mailing list