Skip to contentSkip to conversation

python3-pydantic-core: Enable benchmark tests

PATCH New Khem Raj 1 participant 5 messages Apr 4, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/5 python3-pydantic-core: Enable benchmark tests

Add missing dependencies for additional ptests

---
 .../recipes-devtools/python/python3-pydantic-core_2.16.3.bb    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-pydantic-core_2.16.3.bb +2 -1
index 2086091d63..40478cdbb6 100644
@@ -30,6 +30,8 @@ RDEPENDS:${PN}-ptest += "\
     python3-hypothesis \
     python3-pytest \
     python3-pytest-mock \
+    python3-pytest-timeout \
+    python3-pytest-benchmark \
     python3-unittest-automake-output \
 "
 
@@ -46,5 +48,4 @@ do_install:append() {
 
 do_install_ptest() {
     cp -rf ${S}/tests/ ${D}${PTEST_PATH}/
-    rm -rf ${D}${PTEST_PATH}/tests/benchmarks
 }
Signature · 1 line
2.44.0
author
#1 lore raw

PATCH 2/5 python3-pydbus: Fix typo in ptest package name

---
 meta-python/recipes-devtools/python/python3-pydbus_0.6.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-pydbus_0.6.0.bb +1 -1
index 7399ae1a01..5754fd2adf 100644
@@ -20,7 +20,7 @@ RDEPENDS:${PN} = "python3-pygobject \
                   python3-io \
                   python3-logging"
 
-RDEPENDS:${PN}-ptests = "bash"
+RDEPENDS:${PN}-ptest += "bash"
 
 do_install_ptest() {
         install -d ${D}${PTEST_PATH}/tests
Signature · 1 line
2.44.0
author
#2 lore raw

PATCH 3/5 python3-netaddr: Ignore failing tests on musl

In reply to Khem Raj
---
 meta-python/recipes-devtools/python/python3-netaddr_1.2.1.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-python/recipes-devtools/python/python3-netaddr_1.2.1.bb +3 -0
index 082e7c5025..bedf0dab01 100644
@@ -20,3 +20,6 @@ do_install_ptest() {
     cp -rf ${S}/netaddr/tests/* ${D}${PTEST_PATH}/tests/
 }
 
+do_install_ptest:append:libc-musl () {
+    sed -i -e "/--automake/ s/$/ -k 'not test_strategy_ipv6'/" ${D}${PTEST_PATH}/run-ptest
+}
Signature · 1 line
2.44.0
author
#3 lore raw

PATCH 4/5 python3-pydantic: Ignore failing testcases

In reply to Khem Raj

Lot of them are due to pytestv8

---
 meta-python/recipes-devtools/python/python3-pydantic_2.6.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-pydantic_2.6.4.bb +1 -1
index ddc24d08c6..9c52564121 100644
@@ -49,5 +49,5 @@ do_install_ptest() {
     rm -f ${D}${PTEST_PATH}/tests/test_mypy.py
     # We are not trying to run benchmarks
     rm -rf ${D}${PTEST_PATH}/tests/benchmarks
+    sed -i -e "/--automake/ s/$/ -k 'not test_config_validation_error_cause and not test_dataclass_config_validate_default and not test_annotated_validator_nested and not test_use_bare and not test_use_no_fields and not test_validator_bad_fields_throws_configerror and not test_assert_raises_validation_error and not test_model_config_validate_default'/" ${D}${PTEST_PATH}/run-ptest
 }
-
Signature · 1 line
2.44.0
author
#4 lore raw

PATCH 5/5 python3-pydantic-core: Skip failing ptests

In reply to Khem Raj

possibly due to oe using newer version of pytest

---
 .../recipes-devtools/python/python3-pydantic-core_2.16.3.bb      | 1 +
 1 file changed, 1 insertion(+)
meta-python/recipes-devtools/python/python3-pydantic-core_2.16.3.bb +1 -0
index 40478cdbb6..934e3e2bb2 100644
@@ -48,4 +48,5 @@ do_install:append() {
 
 do_install_ptest() {
     cp -rf ${S}/tests/ ${D}${PTEST_PATH}/
+    sed -i -e "/--automake/ s/$/ -k 'not test_model_class_root_validator_wrap and not test_model_class_root_validator_before and not test_model_class_root_validator_after'/" ${D}${PTEST_PATH}/run-ptest
 }
Signature · 1 line
2.44.0