commit:     0083001fd7b5dc20f3334b356707b08e016bda16
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 26 19:18:05 2022 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 22:10:50 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0083001f

dev-python/httpauth: enable py3.11, drop nose

Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 .../httpauth-0.3-remove-nose-dependency.patch      | 40 ++++++++++++++++++++++
 dev-python/httpauth/httpauth-0.3-r1.ebuild         | 12 +++++--
 2 files changed, 50 insertions(+), 2 deletions(-)

diff --git 
a/dev-python/httpauth/files/httpauth-0.3-remove-nose-dependency.patch 
b/dev-python/httpauth/files/httpauth-0.3-remove-nose-dependency.patch
new file mode 100644
index 000000000000..5cb607c2bb4c
--- /dev/null
+++ b/dev-python/httpauth/files/httpauth-0.3-remove-nose-dependency.patch
@@ -0,0 +1,40 @@
+commit d57060ebaeca8cd38e03cc64f9ee0996e83b50a9
+Author: Jonas Haag <[email protected]>
+Date:   Thu Apr 21 08:58:36 2022 +0200
+
+    Move CI to GHA (#3)
+
+--- a/tests.py
++++ b/tests.py
+@@ -10,7 +10,7 @@ except ImportError: # Python 2
+ 
+ from httpauth import DictHttpAuthMiddleware, DigestFileHttpAuthMiddleware, 
md5_str
+ 
+-from nose.tools import raises
++import pytest
+ 
+ 
+ def parse_dict_header(value):
+@@ -121,16 +121,16 @@ def test_without_realm():
+     assert 'Digest realm=""' in response.headers['WWW-Authenticate']
+ 
+ 
+-@raises(ValueError)
+ def test_invalid_digestfile_1():
+-    DigestFileHttpAuthMiddleware(StringIO('u::realm:hash'),
+-                                 wsgi_app=wsgi_app)
++    with pytest.raises(ValueError):
++        DigestFileHttpAuthMiddleware(StringIO('u::realm:hash'),
++                                     wsgi_app=wsgi_app)
+ 
+ 
+-@raises(ValueError)
+ def test_invalid_digestfile_2():
+-    DigestFileHttpAuthMiddleware(StringIO('u:realm:hash\nu2:realm2:hash2'),
+-                                 wsgi_app=wsgi_app)
++    with pytest.raises(ValueError):
++        
DigestFileHttpAuthMiddleware(StringIO('u:realm:hash\nu2:realm2:hash2'),
++                                     wsgi_app=wsgi_app)
+ 
+ 
+ def test_ticket_1():

diff --git a/dev-python/httpauth/httpauth-0.3-r1.ebuild 
b/dev-python/httpauth/httpauth-0.3-r1.ebuild
index 703fdd988ecb..ae8ef46058ed 100644
--- a/dev-python/httpauth/httpauth-0.3-r1.ebuild
+++ b/dev-python/httpauth/httpauth-0.3-r1.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( pypy3 python3_{8..10} )
+PYTHON_COMPAT=( pypy3 python3_{8..11} )
 
 inherit distutils-r1
 
@@ -16,4 +16,12 @@ LICENSE="ISC"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-distutils_enable_tests nose
+PATCHES=(
+       "${FILESDIR}/${P}-remove-nose-dependency.patch"
+)
+
+distutils_enable_tests pytest
+
+python_test() {
+       epytest tests.py
+}

Reply via email to