From 5a8b476f75c509d191b3755ebbebc5e8354bf4f64bbf1cb72cc98a9ba6ed0df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 23 Nov 2023 13:52:44 +0000 Subject: [PATCH] Accepting request 1128343 from home:mcalabkova:branches:devel:languages:python - Update to 3.0.1 * Add support for Python 3.11. * Drop support for Python 3.6. - Add fix_tests.patch to fix tests one more time * from the commit message: "Doctests were a bad idea." OBS-URL: https://build.opensuse.org/request/show/1128343 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-restview?expand=0&rev=15 --- fix_tests.patch | 108 ++++++++++++++++++++++++++++++++++++++++ python-restview.changes | 9 ++++ python-restview.spec | 8 +-- restview-3.0.0.tar.gz | 3 -- restview-3.0.1.tar.gz | 3 ++ 5 files changed, 125 insertions(+), 6 deletions(-) create mode 100644 fix_tests.patch delete mode 100644 restview-3.0.0.tar.gz create mode 100644 restview-3.0.1.tar.gz diff --git a/fix_tests.patch b/fix_tests.patch new file mode 100644 index 0000000..e230946 --- /dev/null +++ b/fix_tests.patch @@ -0,0 +1,108 @@ +From 6a1d6b44ee400431d75ed2326bd0b4f35d4727fa Mon Sep 17 00:00:00 2001 +From: Marius Gedminas +Date: Mon, 21 Aug 2023 13:11:43 +0300 +Subject: [PATCH] Fix tests + +Not sure why they broke (new docutils release on PyPI)? Doctests were a +bad idea. +--- + src/restview/tests.py | 58 +++++++++---------------------------------- + 1 file changed, 12 insertions(+), 46 deletions(-) + +Index: restview-3.0.1/src/restview/tests.py +=================================================================== +--- restview-3.0.1.orig/src/restview/tests.py ++++ restview-3.0.1/src/restview/tests.py +@@ -540,7 +540,7 @@ def doctest_RestViewer_rest_to_html(): + ... This is an inline literal: ``README.txt``. + ... ''', settings={'cloak_email_addresses': True}).strip()) + ... # doctest: +ELLIPSIS,+REPORT_NDIFF +- ++ + + + +@@ -581,34 +581,12 @@ def doctest_RestViewer_rest_to_html(): + def doctest_RestViewer_rest_to_html_css_url(): + """Test for RestViewer.rest_to_html + +- XXX: this shows pygments styles inlined *after* the external css, which +- means it's hard to override them! +- + >>> viewer = RestViewer('.') + >>> viewer.stylesheets = 'http://example.com/my.css' +- >>> print(viewer.rest_to_html(b''' +- ... Some text +- ... ''').strip()) +- ... # doctest: +ELLIPSIS,+REPORT_NDIFF +- +- +- ... +- ... ++ >>> html = viewer.rest_to_html(b'Some text') ++ >>> grep('stylesheet', html) + +- +- +- +-
+- +- +-

Some text

+-
+- +- +- +- """ ++ """ + + + def doctest_RestViewer_rest_to_html_strict_and_error_handling(): +@@ -714,29 +692,16 @@ def doctest_RestViewer_rest_to_html_pypi + >>> viewer = RestViewer('.') + >>> viewer.stylesheets = None + >>> viewer.pypi_strict = True +- >>> print(viewer.rest_to_html(b''' ++ >>> html = viewer.rest_to_html(b''' + ... Hello + ... ----- + ... + ... `This is fine `__. + ... +- ... ''').strip().replace(""", '"')) +- ... # doctest: +ELLIPSIS,+REPORT_NDIFF +- +- +- ... ++ ... ''') ++ >>> grep('Hello', html) + Hello +-