summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2022-12-25 21:31:53 +0000
committerJames Le Cuirot <chewi@gentoo.org>2022-12-25 21:31:53 +0000
commit3152b6315ed64c84cd4a4bcc8cf583b6ff392aa2 (patch)
tree9c11824168d29796705dad5931a34672cd693684 /dev-python/python-lzo
parentapp-text/barcode: update LICENSE (diff)
downloadgentoo-3152b6315ed64c84cd4a4bcc8cf583b6ff392aa2.tar.gz
gentoo-3152b6315ed64c84cd4a4bcc8cf583b6ff392aa2.tar.bz2
gentoo-3152b6315ed64c84cd4a4bcc8cf583b6ff392aa2.zip
dev-python/python-lzo: Patch to migrate from dead nose to pytest
I've sent this upstream. Closes: https://bugs.gentoo.org/888259 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'dev-python/python-lzo')
-rw-r--r--dev-python/python-lzo/files/python-lzo-1.14-pytest.patch71
-rw-r--r--dev-python/python-lzo/python-lzo-1.14-r1.ebuild6
2 files changed, 76 insertions, 1 deletions
diff --git a/dev-python/python-lzo/files/python-lzo-1.14-pytest.patch b/dev-python/python-lzo/files/python-lzo-1.14-pytest.patch
new file mode 100644
index 000000000000..2abaab19aab5
--- /dev/null
+++ b/dev-python/python-lzo/files/python-lzo-1.14-pytest.patch
@@ -0,0 +1,71 @@
+https://github.com/jd-boyd/python-lzo/pull/66
+
+diff --git a/setup.py b/setup.py
+index 033692d..e7e383d 100644
+--- a/setup.py
++++ b/setup.py
+@@ -33,7 +33,7 @@ class TestCommand(Command):
+ raise SystemExit(
+ subprocess.call([sys.executable,
+ '-m',
+- 'nose']))
++ 'pytest']))
+
+
+ if sys.platform == "win32":
+@@ -91,7 +91,7 @@ setup_args = get_kw(
+ maintainer_email="jdboyd@jdboyd.net",
+ url="https://github.com/jd-boyd/python-lzo",
+ license="GNU General Public License (GPL)",
+- tests_require=['nose'],
++ tests_require=['pytest'],
+ cmdclass={
+ 'test': TestCommand
+ },
+diff --git a/tests/test.py b/tests/test_lzo.py
+similarity index 88%
+rename from tests/test.py
+rename to tests/test_lzo.py
+index af761d9..b9d5c88 100644
+--- a/tests/test.py
++++ b/tests/test_lzo.py
+@@ -32,6 +32,7 @@
+
+ from __future__ import print_function
+
++import pytest
+ import sys, string
+
+ # update sys.path when running in the build directory
+@@ -94,22 +95,20 @@ def test_version():
+ assert pkg_version == mod_version, \
+ "%r != %r" %(pkg_version, mod_version)
+
+-def test_lzo():
+- yield gen, b"aaaaaaaaaaaaaaaaaaaaaaaa"
+- yield gen, b"abcabcabcabcabcabcabcabc"
+- yield gen, b"abcabcabcabcabcabcabcabc", 9
++@pytest.mark.parametrize("src, level", [(b"aaaaaaaaaaaaaaaaaaaaaaaa", 1), (b"abcabcabcabcabcabcabcabc", 1), (b"abcabcabcabcabcabcabcabc", 9)])
++def test_lzo(src, level):
++ gen(src, level)
+
+-
+-def test_lzo_raw():
+- yield gen_raw, b"aaaaaaaaaaaaaaaaaaaaaaaa"
+- yield gen_raw, b"abcabcabcabcabcabcabcabc"
+- yield gen_raw, b"abcabcabcabcabcabcabcabc", 9
++@pytest.mark.parametrize("src, level", [(b"aaaaaaaaaaaaaaaaaaaaaaaa", 1), (b"abcabcabcabcabcabcabcabc", 1), (b"abcabcabcabcabcabcabcabc", 9)])
++def test_lzo_raw(src, level):
++ gen_raw(src, level)
+
+
+ def test_lzo_empty():
+- yield gen, b""
+- yield gen_raw, b""
++ gen(b"")
+
++def test_lzo_empty_raw():
++ gen_raw(b"")
+
+ def test_lzo_big():
+ gen(b" " * 131072)
diff --git a/dev-python/python-lzo/python-lzo-1.14-r1.ebuild b/dev-python/python-lzo/python-lzo-1.14-r1.ebuild
index 6493182b8432..6131a4803068 100644
--- a/dev-python/python-lzo/python-lzo-1.14-r1.ebuild
+++ b/dev-python/python-lzo/python-lzo-1.14-r1.ebuild
@@ -19,9 +19,13 @@ KEYWORDS="amd64 ~riscv x86 ~amd64-linux ~x86-linux"
RDEPEND="dev-libs/lzo:2"
DEPEND="${RDEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${P}-pytest.patch
+)
+
# We can't use pytest at the moment because the package uses "yield tests"
# https://docs.pytest.org/en/6.2.x/deprecations.html#yield-tests
-distutils_enable_tests nose
+distutils_enable_tests pytest
python_prepare_all() {
hprefixify setup.py