commit: 056991a706e3c0d4e5e5c28153fb0e7a3fe128b6
Author: David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Fri Mar 13 17:42:14 2020 +0000
Commit: David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Fri Mar 13 17:42:34 2020 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=056991a7
dev-python/python-telegram-bot: fix tests
Package-Manager: Portage-2.3.93, Repoman-2.3.20
Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
.../python-telegram-bot-12.4.2.ebuild | 39 ++++++++++------------
.../python-telegram-bot-9999.ebuild | 39 ++++++++++------------
2 files changed, 36 insertions(+), 42 deletions(-)
diff --git a/dev-python/python-telegram-bot/python-telegram-bot-12.4.2.ebuild
b/dev-python/python-telegram-bot/python-telegram-bot-12.4.2.ebuild
index 6004623..497474b 100644
--- a/dev-python/python-telegram-bot/python-telegram-bot-12.4.2.ebuild
+++ b/dev-python/python-telegram-bot/python-telegram-bot-12.4.2.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_COMPAT=( python3_{6,7} )
inherit distutils-r1
@@ -22,10 +22,6 @@ fi
LICENSE="GPL-3"
SLOT="0"
-# No tests because require networking access
-# Commenting out the test deps so we can add py3_8
-RESTRICT="test"
-
RDEPEND="
dev-python/certifi[${PYTHON_USEDEP}]
dev-python/cryptography[${PYTHON_USEDEP}]
@@ -37,15 +33,15 @@ RDEPEND="
www-servers/tornado[${PYTHON_USEDEP}]
"
-#DEPEND="test? (
-# dev-python/attrs[${PYTHON_USEDEP}]
-# dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
-# dev-python/flake8[${PYTHON_USEDEP}]
-# dev-python/flaky[${PYTHON_USEDEP}]
-# dev-python/pylint[${PYTHON_USEDEP}]
-# dev-python/pytest-timeout[${PYTHON_USEDEP}]
-# dev-python/yapf[${PYTHON_USEDEP}]
-#)"
+DEPEND="test? (
+ dev-python/attrs[${PYTHON_USEDEP}]
+ dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
+ dev-python/flake8[${PYTHON_USEDEP}]
+ dev-python/flaky[${PYTHON_USEDEP}]
+ dev-python/pylint[${PYTHON_USEDEP}]
+ dev-python/pytest-timeout[${PYTHON_USEDEP}]
+ dev-python/yapf[${PYTHON_USEDEP}]
+)"
distutils_enable_tests pytest
distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
@@ -54,14 +50,15 @@ python_prepare_all() {
# do not make a test flaky report
sed -i -e '/addopts/d' setup.cfg || die
- # this test fails: Unknown pytest.mark.nocoverage
- # likely this requires pytest-cov but that is deprecated
- # so we skip the test
- rm tests/test_meta.py || die
+ sed -i 's/from telegram.vendor.ptb_urllib3 //g' tests/test_*.py
+ sed -i 's/telegram.vendor.ptb_urllib3.urllib3/urllib3/g' tests/test_*.py
- # this fails to import urllib3 even though
- # it is installed
- rm tests/test_official.py || die
+ # Remove tests files that require network access
+ rm
tests/test_{animation,audio,bot,commandhandler,constants,conversationhandler}.py
|| die
+ rm
tests/test_{dispatcher,document,forcereply,inlinekeyboardmarkup,inputmedia}.py
|| die
+ rm
tests/test_{invoice,jobqueue,official,parsemode,persistence,photo,sticker,updater}.py
|| die
+ rm tests/test_replykeyboard{markup,remove}.py || die
+ rm tests/test_{video,videonote,voice}.py || die
distutils-r1_python_prepare_all
}
diff --git a/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild
b/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild
index 6004623..497474b 100644
--- a/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild
+++ b/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_COMPAT=( python3_{6,7} )
inherit distutils-r1
@@ -22,10 +22,6 @@ fi
LICENSE="GPL-3"
SLOT="0"
-# No tests because require networking access
-# Commenting out the test deps so we can add py3_8
-RESTRICT="test"
-
RDEPEND="
dev-python/certifi[${PYTHON_USEDEP}]
dev-python/cryptography[${PYTHON_USEDEP}]
@@ -37,15 +33,15 @@ RDEPEND="
www-servers/tornado[${PYTHON_USEDEP}]
"
-#DEPEND="test? (
-# dev-python/attrs[${PYTHON_USEDEP}]
-# dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
-# dev-python/flake8[${PYTHON_USEDEP}]
-# dev-python/flaky[${PYTHON_USEDEP}]
-# dev-python/pylint[${PYTHON_USEDEP}]
-# dev-python/pytest-timeout[${PYTHON_USEDEP}]
-# dev-python/yapf[${PYTHON_USEDEP}]
-#)"
+DEPEND="test? (
+ dev-python/attrs[${PYTHON_USEDEP}]
+ dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
+ dev-python/flake8[${PYTHON_USEDEP}]
+ dev-python/flaky[${PYTHON_USEDEP}]
+ dev-python/pylint[${PYTHON_USEDEP}]
+ dev-python/pytest-timeout[${PYTHON_USEDEP}]
+ dev-python/yapf[${PYTHON_USEDEP}]
+)"
distutils_enable_tests pytest
distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
@@ -54,14 +50,15 @@ python_prepare_all() {
# do not make a test flaky report
sed -i -e '/addopts/d' setup.cfg || die
- # this test fails: Unknown pytest.mark.nocoverage
- # likely this requires pytest-cov but that is deprecated
- # so we skip the test
- rm tests/test_meta.py || die
+ sed -i 's/from telegram.vendor.ptb_urllib3 //g' tests/test_*.py
+ sed -i 's/telegram.vendor.ptb_urllib3.urllib3/urllib3/g' tests/test_*.py
- # this fails to import urllib3 even though
- # it is installed
- rm tests/test_official.py || die
+ # Remove tests files that require network access
+ rm
tests/test_{animation,audio,bot,commandhandler,constants,conversationhandler}.py
|| die
+ rm
tests/test_{dispatcher,document,forcereply,inlinekeyboardmarkup,inputmedia}.py
|| die
+ rm
tests/test_{invoice,jobqueue,official,parsemode,persistence,photo,sticker,updater}.py
|| die
+ rm tests/test_replykeyboard{markup,remove}.py || die
+ rm tests/test_{video,videonote,voice}.py || die
distutils-r1_python_prepare_all
}