From 6a1d6b44ee400431d75ed2326bd0b4f35d4727fa Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Mon, 21 Aug 2023 13:11:43 +0300 Subject: [PATCH 1/2] Fix tests Not sure why they broke (new docutils release on PyPI)? Doctests were a bad idea. Upstream-commit: https://github.com/mgedmin/restview/commit/6a1d6b44ee400431d75ed2326bd0b4f35d4727fa diff --git a/src/restview/tests.py b/src/restview/tests.py index 71aeb77..d129835 100644 --- a/src/restview/tests.py +++ b/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 - + @@ -584,35 +584,11 @@ 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

-
- - """ @@ -720,32 +696,16 @@ def doctest_RestViewer_rest_to_html_pypi_strict(): >>> 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 - -
+

example

This is a doctest:

@@ -570,11 +569,9 @@ def doctest_RestViewer_rest_to_html():

This is a reference: README.rst

This is an email: marius@gedmin.as

This is a literal block:

-
-        See CHANGES.rst, mkay?
-        
+
See CHANGES.rst, mkay?

This is an inline literal: README.txt.

-
+ -- 2.44.2