#14 Backport patch to fix failing tests with Python 3.11
Merged 2 years ago by churchyard. Opened 2 years ago by thrnciar.
rpms/ thrnciar/python-mako backport-py3.11-patch  into  rawhide

@@ -0,0 +1,38 @@ 

+ From 9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8 Mon Sep 17 00:00:00 2001

+ From: Mike Bayer <mike_mp@zzzcomputing.com>

+ Date: Sat, 9 Apr 2022 11:43:32 -0400

+ Subject: [PATCH] reduce exception message tested for py311 compat

+ 

+ Change-Id: I519d4a840fd456ea042a5b0735da183a1e340aa4

+ ---

+  test/test_exceptions.py | 10 ++--------

+  1 file changed, 2 insertions(+), 8 deletions(-)

+ 

+ diff --git a/test/test_exceptions.py b/test/test_exceptions.py

+ index b1930c5..7a2e6b0 100644

+ --- a/test/test_exceptions.py

+ +++ b/test/test_exceptions.py

+ @@ -274,10 +274,7 @@ def test_tback_no_trace_from_py_file(self):

+          html_error = exceptions.html_error_template().render_unicode(

+              error=v, traceback=None

+          )

+ -        assert (

+ -            "local variable &#39;y&#39; referenced before assignment"

+ -            in html_error

+ -        )

+ +        assert "local variable &#39;y&#39;" in html_error

+  

+      def test_tback_trace_from_py_file(self):

+          t = self._file_template("runtimeerr.html")

+ @@ -287,10 +284,7 @@ def test_tback_trace_from_py_file(self):

+          except:

+              html_error = exceptions.html_error_template().render_unicode()

+  

+ -        assert (

+ -            "local variable &#39;y&#39; referenced before assignment"

+ -            in html_error

+ -        )

+ +        assert "local variable &#39;y&#39;" in html_error

+  

+      def test_code_block_line_number(self):

+          l = TemplateLookup()

file modified
+3
@@ -9,6 +9,9 @@ 

  URL: http://www.makotemplates.org/

  Source0: https://github.com/sqlalchemy/mako/archive/rel_%(echo %{version} | sed "s/\./_/g").tar.gz

  

+ # patch for Python 3.11 compatibility to reduce exception message

+ Patch: https://github.com/sqlalchemy/mako/commit/9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8.patch

+ 

  BuildRequires: python3-devel

  BuildRequires: python3-pytest

  BuildRequires: python3-setuptools

no initial comment

Pull-Request has been merged by churchyard

2 years ago