From c28061e016b501ce99a99bad164c7222cc28c70fda5048296668b72af1ffd530 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 27 Dec 2020 22:25:33 +0000 Subject: [PATCH] Accepting request 858798 from home:poorboywilly:branches:devel:languages:python - Add patch to fix test: according to Pandoc documentation, ATX-style headings are the default. See https://pandoc.org/MANUAL#option--markdown-headings OBS-URL: https://build.opensuse.org/request/show/858798 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pypandoc?expand=0&rev=5 --- fix-test.patch | 21 +++++++++++++++++++++ python-pypandoc.changes | 7 +++++++ python-pypandoc.spec | 4 ++++ 3 files changed, 32 insertions(+) create mode 100644 fix-test.patch diff --git a/fix-test.patch b/fix-test.patch new file mode 100644 index 0000000..afd1707 --- /dev/null +++ b/fix-test.patch @@ -0,0 +1,21 @@ +diff -ur pypandoc-1.5/tests.py pypandoc-1.5b/tests.py +--- pypandoc-1.5/tests.py 2020-04-12 18:41:24.000000000 -0600 ++++ pypandoc-1.5b/tests.py 2020-12-26 20:43:28.293871252 -0700 +@@ -293,7 +293,7 @@ + + def test_unicode_input(self): + # make sure that pandoc always returns unicode and does not mishandle it +- expected = u'üäöîôû{0}======{0}{0}'.format(os.linesep) ++ expected = u'# üäöîôû{0}{0}'.format(os.linesep) + written = pypandoc.convert_text(u'

üäöîôû

', 'md', format='html') + self.assertTrue(isinstance(written, unicode_type)) + self.assertEqualExceptForNewlineEnd(expected, written) +@@ -303,7 +303,7 @@ + self.assertTrue(isinstance(written, unicode_type)) + + # Only use german umlauts in th next test, as iso-8859-15 covers that +- expected = u'üäö€{0}===={0}{0}'.format(os.linesep) ++ expected = u'# üäö€{0}{0}'.format(os.linesep) + bytes = u'

üäö€

'.encode("iso-8859-15") + + # Without encoding, this fails as we expect utf-8 per default diff --git a/python-pypandoc.changes b/python-pypandoc.changes index 3ed06a0..adccd55 100644 --- a/python-pypandoc.changes +++ b/python-pypandoc.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Dec 27 03:51:58 UTC 2020 - Jason Craig + +- Add patch to fix test: according to Pandoc documentation, ATX-style +headings are the default. See +https://pandoc.org/MANUAL#option--markdown-headings + ------------------------------------------------------------------- Sun Nov 22 13:21:43 UTC 2020 - John Vandenberg diff --git a/python-pypandoc.spec b/python-pypandoc.spec index aabd496..5bad503 100644 --- a/python-pypandoc.spec +++ b/python-pypandoc.spec @@ -25,6 +25,9 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/bebraw/pypandoc Source: https://pypi.org/packages/source/p/pypandoc/pypandoc-%{version}.tar.gz +# PATCH-FIX-UPSTREAM fix-test.patch -- ATX-style headings are default for +# markdown, see https://pandoc.org/MANUAL#option--markdown-headings +Patch1: fix-test.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} @@ -46,6 +49,7 @@ pypandoc provides a thin wrapper for pandoc, a universal document converter. %prep %setup -q -n pypandoc-%{version} +%autopatch -p1 # Disable test that requires internet sed -i 's/\(test_basic_conversion_from_http_url\)/_\1/' tests.py