commit:     1318b57781b14c91c7ebba456fe85f190c688277
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  3 00:24:23 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct  3 00:27:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1318b577

dev-python/pyrqlite: Elminate non-public test.support usage

Closes: https://bugs.gentoo.org/940579
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 .../files/pyrqlite-2.2.3-test-support.patch        | 50 ++++++++++++++++++++++
 dev-python/pyrqlite/pyrqlite-2.2.3.ebuild          |  1 +
 2 files changed, 51 insertions(+)

diff --git a/dev-python/pyrqlite/files/pyrqlite-2.2.3-test-support.patch 
b/dev-python/pyrqlite/files/pyrqlite-2.2.3-test-support.patch
new file mode 100644
index 000000000000..06559446ef12
--- /dev/null
+++ b/dev-python/pyrqlite/files/pyrqlite-2.2.3-test-support.patch
@@ -0,0 +1,50 @@
+From cb5ba83c0ba95eae0026afdc8ae0312b8e51f647 Mon Sep 17 00:00:00 2001
+From: Zac Medico <[email protected]>
+Date: Wed, 2 Oct 2024 16:48:38 -0700
+Subject: [PATCH] Eliminate non-public test.support usage
+
+This fixes the "No module named test" issue reported here:
+
+https://bugs.gentoo.org/940579
+---
+ src/test/test_dbapi.py | 17 ++++++-----------
+ 1 file changed, 6 insertions(+), 11 deletions(-)
+
+diff --git a/src/test/test_dbapi.py b/src/test/test_dbapi.py
+index df32f2f..cb756d2 100644
+--- a/src/test/test_dbapi.py
++++ b/src/test/test_dbapi.py
+@@ -24,13 +24,6 @@
+ from __future__ import print_function
+ 
+ import sys
+-try:
+-    import test.support.warnings_helper as test_support
+-except ImportError:
+-    try:
+-        import test.support as test_support
+-    except ImportError:
+-        from test import test_support
+ import unittest
+ 
+ import pyrqlite.dbapi2 as sqlite
+@@ -571,10 +564,12 @@ class ConstructorTests(unittest.TestCase):
+         ts = sqlite.TimestampFromTicks(42)
+ 
+     def test_CheckBinary(self):
+-        with (test_support.check_warnings() if sys.version_info[0] >= 3
+-            else test_support.check_py3k_warnings()):
+-            b = sqlite.Binary(chr(0).encode() + b"'"
+-                if sys.version_info[0] >= 3 else chr(0) + b"'")
++        self.assertEqual(
++            b"\0'",
++            sqlite.Binary(
++                chr(0).encode() + b"'" if sys.version_info[0] >= 3 else 
chr(0) + b"'"
++            ),
++        )
+ 
+ class ExtensionTests(unittest.TestCase):
+     @classmethod
+-- 
+2.45.2
+

diff --git a/dev-python/pyrqlite/pyrqlite-2.2.3.ebuild 
b/dev-python/pyrqlite/pyrqlite-2.2.3.ebuild
index ec12bed1b7aa..133e7efb299b 100644
--- a/dev-python/pyrqlite/pyrqlite-2.2.3.ebuild
+++ b/dev-python/pyrqlite/pyrqlite-2.2.3.ebuild
@@ -26,5 +26,6 @@ BDEPEND="
                >=dev-db/rqlite-6.7.0
        )
 "
+PATCHES=("${FILESDIR}/pyrqlite-2.2.3-test-support.patch")
 
 distutils_enable_tests pytest

Reply via email to