[packages/python-ukpostcodeparser] - patch to adjust for current unittest API (assertEqual instead of assertEquals)
qboosh
qboosh at pld-linux.org
Sun Jul 13 17:02:29 CEST 2025
commit 089d0dbb0a97925cada3b787e73726f45833762e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Jul 13 17:04:01 2025 +0200
- patch to adjust for current unittest API (assertEqual instead of assertEquals)
UkPostcodeParser-unittest.patch | 38 ++++++++++++++++++++++++++++++++++++++
python-ukpostcodeparser.spec | 2 ++
2 files changed, 40 insertions(+)
---
diff --git a/python-ukpostcodeparser.spec b/python-ukpostcodeparser.spec
index 0284dbd..87f6efb 100644
--- a/python-ukpostcodeparser.spec
+++ b/python-ukpostcodeparser.spec
@@ -15,6 +15,7 @@ Group: Libraries/Python
Source0: https://files.pythonhosted.org/packages/source/U/UkPostcodeParser/UkPostcodeParser-%{version}.tar.gz
# Source0-md5: 763ed9144915f9647fa5bded2f03ae75
Patch0: UkPostcodeParser-tests.patch
+Patch1: UkPostcodeParser-unittest.patch
URL: https://pypi.org/project/UkPostcodeParser/
%if %{with python2}
BuildRequires: python-modules >= 1:2.5
@@ -51,6 +52,7 @@ Analizator kodów pocztowych Wielkiej Brytanii.
%prep
%setup -q -n UkPostcodeParser-%{version}
%patch -P 0 -p1
+%patch -P 1 -p1
%build
%if %{with python2}
diff --git a/UkPostcodeParser-unittest.patch b/UkPostcodeParser-unittest.patch
new file mode 100644
index 0000000..94ea24e
--- /dev/null
+++ b/UkPostcodeParser-unittest.patch
@@ -0,0 +1,38 @@
+--- UkPostcodeParser-1.1.2/ukpostcodeparser/test/parser.py.orig 2025-07-13 17:00:27.881274081 +0200
++++ UkPostcodeParser-1.1.2/ukpostcodeparser/test/parser.py 2025-07-13 17:02:39.203895979 +0200
+@@ -18,7 +18,7 @@ class BackwardsCompatibilityTestCase(uni
+
+ with self.assertRaises(ValueError) as cm:
+ parse_uk_postcode('N16', True, True)
+- self.assertEquals(cm.exception.__class__, IncodeNotFoundError)
++ self.assertEqual(cm.exception.__class__, IncodeNotFoundError)
+
+ def test_max_length_exceeded_error_is_value_error(self):
+ """
+@@ -28,7 +28,7 @@ class BackwardsCompatibilityTestCase(uni
+
+ with self.assertRaises(ValueError) as cm:
+ parse_uk_postcode('N16 8QSSS', True, True)
+- self.assertEquals(cm.exception.__class__, MaxLengthExceededError)
++ self.assertEqual(cm.exception.__class__, MaxLengthExceededError)
+
+ def test_invalid_postcode_error_is_value_error(self):
+ """
+@@ -38,7 +38,7 @@ class BackwardsCompatibilityTestCase(uni
+
+ with self.assertRaises(ValueError) as cm:
+ parse_uk_postcode('xx0 2yr', True, True)
+- self.assertEquals(cm.exception.__class__, InvalidPostcodeError)
++ self.assertEqual(cm.exception.__class__, InvalidPostcodeError)
+
+
+ class PostcodeTestCase(unittest.TestCase):
+@@ -68,7 +68,7 @@ class PostcodeTestCase(unittest.TestCase
+ m = 'Expected {!r} but got {!r} for postcode={!r}, strict={!r} and ' \
+ 'incode_mandatory={!r}'
+
+- self.assertEquals(
++ self.assertEqual(
+ expected,
+ result,
+ m.format(
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-ukpostcodeparser.git/commitdiff/089d0dbb0a97925cada3b787e73726f45833762e
More information about the pld-cvs-commit
mailing list