dev-python/tornado: add test suite tweaks

- Skip tests marked as skipOnTravis (timing sensitive)
- Explicitly set NO_NETWORK too to avoid network tests
- Don't treat DeprecationWarning as fatal for tests (grabbed from Fedora)

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2023-05-28 23:50:10 +01:00
parent 74a7b87205
commit e2675dd4fd
2 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
https://src.fedoraproject.org/rpms/python-tornado/raw/rawhide/f/Do-not-turn-DeprecationWarning-into-Exception.patch
--- a/tornado/test/runtests.py
+++ b/tornado/test/runtests.py
@@ -126,7 +126,6 @@
# Tornado generally shouldn't use anything deprecated, but some of
# our dependencies do (last match wins).
warnings.filterwarnings("ignore", category=DeprecationWarning)
- warnings.filterwarnings("error", category=DeprecationWarning, module=r"tornado\..*")
warnings.filterwarnings("ignore", category=PendingDeprecationWarning)
warnings.filterwarnings(
"error", category=PendingDeprecationWarning, module=r"tornado\..*"

View File

@@ -5,7 +5,7 @@ EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..11} pypy3 )
PYTHON_COMPAT=( python3_{10..11} pypy3 )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 pypi
@@ -37,6 +37,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-6.3.2-test-timeout-increase.patch
"${FILESDIR}"/${PN}-6.3.2-ignore-deprecationwarning.patch
)
src_prepare() {
@@ -49,6 +50,11 @@ src_prepare() {
python_test() {
local -x ASYNC_TEST_TIMEOUT=60
# Avoid time-sensitive tests
# https://github.com/tornadoweb/tornado/blob/10974e6ebee80a26a2a65bb9bd715cf858fafde5/tornado/test/util.py#L19
local -x TRAVIS=1
local -x NO_NETWORK=1
cd "${T}" || die
"${EPYTHON}" -m tornado.test.runtests --verbose ||
die "tests failed under ${EPYTHON}"