commit:     19463e89b69204786b0d03b21df28113f4391cdb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  4 14:34:54 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jun  4 14:40:52 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19463e89

dev-python/wtforms: Enable py3.10, fix tests

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

 dev-python/wtforms/wtforms-2.3.3.ebuild | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/dev-python/wtforms/wtforms-2.3.3.ebuild 
b/dev-python/wtforms/wtforms-2.3.3.ebuild
index 2f4d412cdd5..feb41b79791 100644
--- a/dev-python/wtforms/wtforms-2.3.3.ebuild
+++ b/dev-python/wtforms/wtforms-2.3.3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-PYTHON_COMPAT=( pypy3 python3_{7..9} )
+PYTHON_COMPAT=( pypy3 python3_{8..10} )
 inherit distutils-r1
 
 MY_PN="WTForms"
@@ -31,19 +31,30 @@ BDEPEND="
        )
 "
 
-distutils_enable_tests unittest
+distutils_enable_tests pytest
 
 python_prepare_all() {
-       # Extension-tests are written for an older version of Django
-       # Disable pep8 even when it is installed
-       sed \
-               -e "s|'ext_django.tests', ||" \
-               -e "/import pep8/d" \
-               -e "s|has_pep8 = True|has_pep8 = False|" \
-               -i tests/runtests.py || die
+       # use pytest instead of ugly custom test runner
+       cat >> setup.cfg <<-EOF || die
+               [tool:pytest]
+               python_files = *.py
+       EOF
+
        distutils-r1_python_prepare_all
 }
 
 python_test() {
-       "${EPYTHON}" tests/runtests.py -v || die
+       local ignore=(
+               # requires gaetest_common... also upstream doesn't run it at all
+               tests/ext_appengine
+               # requires old django; also extensions are deprecated anyway
+               tests/ext_django
+       )
+       local deselect=(
+               # incompatible with sqlalchemy-1.4
+               tests/ext_sqlalchemy.py::QuerySelectFieldTest
+               tests/ext_sqlalchemy.py::QuerySelectMultipleFieldTest
+       )
+
+       epytest tests ${ignore[@]/#/--ignore } ${deselect[@]/#/--deselect }
 }

Reply via email to