From c66ca5fb3d2a06c603b42e55a723d8c5684185fc Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 17 Jun 2024 17:48:33 +0200 Subject: dev-python/pymdown-extensions: Fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- .../files/pymdown-extensions-10.8.1-test.patch | 66 ++++++++++++++++++++++ .../pymdown-extensions-10.8.1.ebuild | 13 ++--- 2 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 dev-python/pymdown-extensions/files/pymdown-extensions-10.8.1-test.patch (limited to 'dev-python/pymdown-extensions') 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 +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): + ``` + ''', + ''' +-
import test
++            
import test
+             test.test()
+             
+- ''', ++ ''', # noqa: E501 + True + ) + +@@ -52,10 +52,10 @@ def test_guess_block(self): + ``` + ''', + ''' +-
import test
++            
import test
+             test.test()
+             
+- ''', ++ ''', # 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'

import module.

' ++ r'

import module.

' # noqa: E501 + ) + + +@@ -251,7 +251,7 @@ def test_guessing_inline(self): + + self.check_markdown( + r'`import module`.', +- r'

import module.

' ++ r'

import module.

' # 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 -- cgit v1.2.3-65-gdbad