diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2021-10-02 14:36:00 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2021-10-02 14:39:34 +0300 |
commit | 1d8f5f991ed64c1e88c645234a1f3991e87c0b88 (patch) | |
tree | b7593b64b31f66c9c0cf794ee25ffccbdb3a4495 /dev-python/flask-mongoengine | |
parent | dev-python/mongoengine: enable py3.10, cleanup testing (diff) | |
download | gentoo-1d8f5f991ed64c1e88c645234a1f3991e87c0b88.tar.gz gentoo-1d8f5f991ed64c1e88c645234a1f3991e87c0b88.tar.bz2 gentoo-1d8f5f991ed64c1e88c645234a1f3991e87c0b88.zip |
dev-python/flask-mongoengine: enable py3.10, cleanup testing
- use EPYTEST_DESELECT for disabling tests
- in case loading mongod fails, instead of redirecting to log file,
output it, to make it easier sending build.log with all info
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/flask-mongoengine')
-rw-r--r-- | dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild b/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild index 333446b4453e..ea5a729c1b49 100644 --- a/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild +++ b/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7..9} ) +PYTHON_COMPAT=( python3_{8..10} ) inherit distutils-r1 DESCRIPTION="Flask support for MongoDB and with WTF model forms" @@ -31,35 +31,36 @@ distutils_enable_tests pytest python_prepare_all() { sed -i -e '/addopts/d' setup.cfg || die - # fails with mongomock installed - sed -e 's:test_connection__should_parse_mongo_mock_uri:_&:' \ - -i tests/test_connection.py || die - distutils-r1_python_prepare_all } python_test() { + local EPYTEST_DESELECT=( + # fails with mongomock installed + tests/test_connection.py::test_connection__should_parse_mongo_mock_uri__as_uri_and_as_settings + ) local dbpath=${TMPDIR}/mongo.db local logpath=${TMPDIR}/mongod.log + local DB_PORT=27017 mkdir -p "${dbpath}" || die ebegin "Trying to start mongod on port ${DB_PORT}" LC_ALL=C \ mongod --dbpath "${dbpath}" --nojournal \ - --bind_ip 127.0.0.1 --port 27017 \ + --bind_ip 127.0.0.1 --port ${DB_PORT} \ --unixSocketPrefix "${TMPDIR}" \ --logpath "${logpath}" --fork || die sleep 2 # Now we need to check if the server actually started... - if [[ -S "${TMPDIR}"/mongodb-27017.sock ]]; then + if [[ -S "${TMPDIR}"/mongodb-${DB_PORT}.sock ]]; then # yay! eend 0 else eend 1 - eerror "Unable to start mongod for tests. See the server log:" - eerror " ${logpath}" + eerror "Unable to start mongod for tests. Here is the server log:" + cat "${logpath}" die "Unable to start mongod for tests." fi |