sissaschool / xmlschema

XML Schema validator and data conversion library for Python
MIT License
406 stars 76 forks source link

Incorrect error message in pickling test for Python 3.12 in Debian #412

Open NGC2023 opened 3 weeks ago

NGC2023 commented 3 weeks ago

Hi, The test_pickling_subclassed_schema__issue_263 test fails in Python 3.12 during build in Debian due to a change in the error message format for pickling failures. The test is currently expecting an outdated error message. It needs to be updated to reflect the new error message format to correctly handle and verify pickling errors for subclassed XML schema objects.

--- a/tests/validators/test_schemas.py
+++ b/tests/validators/test_schemas.py
@@ -702,7 +702,7 @@ class TestXMLSchema10(XsdValidatorTestCa

         with self.assertRaises((pickle.PicklingError, AttributeError)) as ec:
             pickle.dumps(schema)
-        self.assertIn("Can't pickle", str(ec.exception))
+        self.assertIn("Can't get local object", str(ec.exception))

     def test_meta_schema_validation(self):
         self.assertTrue(self.schema_class.meta_schema.is_valid(self.vh_xsd_file))
brunato commented 3 weeks ago

Hi, it should be in Debian sid i suppose. The change is in Python 3.12.5, i will add a condition on sys.version_info for this test.

Thank you