commit:     c66ca5fb3d2a06c603b42e55a723d8c5684185fc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 17 15:48:33 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 16:25:46 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c66ca5fb

dev-python/pymdown-extensions: Fix tests

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/pymdown-extensions-10.8.1-test.patch     | 66 ++++++++++++++++++++++
 .../pymdown-extensions-10.8.1.ebuild               | 13 ++---
 2 files changed, 70 insertions(+), 9 deletions(-)

diff --git 
a/dev-python/pymdown-extensions/files/pymdown-extensions-10.8.1-test.patch 
b/dev-python/pymdown-extensions/files/pymdown-extensions-10.8.1-test.patch
new file mode 100644
index 000000000000..507494094b73
--- /dev/null
+++ b/dev-python/pymdown-extensions/files/pymdown-extensions-10.8.1-test.patch
@@ -0,0 +1,66 @@
+From 321d5d8c7fa5965cb4c933eae8371113d40f9932 Mon Sep 17 00:00:00 2001
+From: facelessuser <faceless.s...@gmail.com>
+Date: Sun, 5 May 2024 06:50:56 -0600
+Subject: [PATCH] Update tests to account for latest Ruff and Pygments updates
+
+- Fix warning in Ruff
+- Fix test expectations of Pygments lexer output
+
+Fixes #2378
+---
+ tests/test_extensions/test_highlight.py    | 8 ++++----
+ tests/test_extensions/test_inlinehilite.py | 4 ++--
+ 3 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tests/test_extensions/test_highlight.py 
b/tests/test_extensions/test_highlight.py
+index 2b020a8a2..4d4433c80 100644
+--- a/tests/test_extensions/test_highlight.py
++++ b/tests/test_extensions/test_highlight.py
+@@ -23,10 +23,10 @@ def test_guess(self):
+             ```
+             ''',
+             '''
+-            <div class="highlight"><pre><span></span><code><span 
class="kn">import</span> <span class="nn">test</span>
++            <div class="highlight"><pre><span></span><code><span 
class="kn">import</span><span class="w"> </span><span class="nn">test</span>
+             <span class="n">test</span><span class="o">.</span><span 
class="n">test</span><span class="p">()</span>
+             </code></pre></div>
+-            ''',
++            ''',  # noqa: E501
+             True
+         )
+ 
+@@ -52,10 +52,10 @@ def test_guess_block(self):
+             ```
+             ''',
+             '''
+-            <div class="highlight"><pre><span></span><code><span 
class="kn">import</span> <span class="nn">test</span>
++            <div class="highlight"><pre><span></span><code><span 
class="kn">import</span><span class="w"> </span><span class="nn">test</span>
+             <span class="n">test</span><span class="o">.</span><span 
class="n">test</span><span class="p">()</span>
+             </code></pre></div>
+-            ''',
++            ''',  # noqa: E501
+             True
+         )
+ 
+diff --git a/tests/test_extensions/test_inlinehilite.py 
b/tests/test_extensions/test_inlinehilite.py
+index 3cb853070..c82baa6dc 100644
+--- a/tests/test_extensions/test_inlinehilite.py
++++ b/tests/test_extensions/test_inlinehilite.py
+@@ -224,7 +224,7 @@ def test_guessing(self):
+ 
+         self.check_markdown(
+             r'`import module`.',
+-            r'<p><code class="inlinehilite"><span class="kn">import</span> 
<span class="nn">module</span></code>.</p>'
++            r'<p><code class="inlinehilite"><span 
class="kn">import</span><span class="w"> </span><span 
class="nn">module</span></code>.</p>'  # noqa: E501
+         )
+ 
+ 
+@@ -251,7 +251,7 @@ def test_guessing_inline(self):
+ 
+         self.check_markdown(
+             r'`import module`.',
+-            r'<p><code class="inlinehilite"><span class="kn">import</span> 
<span class="nn">module</span></code>.</p>'
++            r'<p><code class="inlinehilite"><span 
class="kn">import</span><span class="w"> </span><span 
class="nn">module</span></code>.</p>'  # noqa: E501
+         )
+ 
+     def test_no_guessing_block(self):

diff --git a/dev-python/pymdown-extensions/pymdown-extensions-10.8.1.ebuild 
b/dev-python/pymdown-extensions/pymdown-extensions-10.8.1.ebuild
index 8f28adec21d5..59752923d9ee 100644
--- a/dev-python/pymdown-extensions/pymdown-extensions-10.8.1.ebuild
+++ b/dev-python/pymdown-extensions/pymdown-extensions-10.8.1.ebuild
@@ -31,15 +31,10 @@ BDEPEND="
 
 distutils_enable_tests pytest
 
-src_prepare() {
-       # broken on pypy3; unfortunately, the parametrization is based
-       # on indexes and these are pretty random, so we need to remove it
-       # entirely
-       # TODO: restore it when pypy with a fix is in Gentoo
-       # https://github.com/pypy/pypy/issues/4920
-       rm "tests/extensions/superfences/superfences (normal).txt" || die
-       distutils-r1_src_prepare
-}
+PATCHES=(
+       # https://github.com/facelessuser/pymdown-extensions/pull/2379
+       "${FILESDIR}/${P}-test.patch"
+)
 
 python_test() {
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1

Reply via email to