From b6e880dcdaf43e6b5dd43722906799c9dbf1f781 Mon Sep 17 00:00:00 2001 From: Davide Brunato Date: Tue, 20 Aug 2024 14:18:40 +0200 Subject: [PATCH] Use sys.version_info in test_pickling_subclassed_schema__issue_263 - Select the result for pickle serialization of schema instance --- tests/validators/test_schemas.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/validators/test_schemas.py b/tests/validators/test_schemas.py index 1acc8cc..84090c0 100644 --- a/tests/validators/test_schemas.py +++ b/tests/validators/test_schemas.py @@ -8,6 +8,7 @@ # # @author Davide Brunato # +import sys import unittest import filecmp import logging @@ -860,7 +861,11 @@ class TestXMLSchema10(XsdValidatorTestCase): with self.assertRaises((pickle.PicklingError, AttributeError)) as ec: pickle.dumps(schema) - self.assertIn("Can't pickle", str(ec.exception)) + + if sys.version_info[:3] <= (3, 12, 4): + self.assertIn("Can't pickle", str(ec.exception)) + else: + self.assertIn("Can't get local object", str(ec.exception)) def test_deprecated_check_schema_method(self): -- 2.43.5