Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/flask-mongoengine/
Date: Sat, 02 Oct 2021 11:40:00
Message-Id: 1633174774.1d8f5f991ed64c1e88c645234a1f3991e87c0b88.arthurzam@gentoo
1 commit: 1d8f5f991ed64c1e88c645234a1f3991e87c0b88
2 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 2 11:36:00 2021 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 2 11:39:34 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d8f5f99
7
8 dev-python/flask-mongoengine: enable py3.10, cleanup testing
9
10 - use EPYTEST_DESELECT for disabling tests
11 - in case loading mongod fails, instead of redirecting to log file,
12 output it, to make it easier sending build.log with all info
13
14 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
15
16 .../flask-mongoengine/flask-mongoengine-1.0.0.ebuild | 19 ++++++++++---------
17 1 file changed, 10 insertions(+), 9 deletions(-)
18
19 diff --git a/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild b/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild
20 index 333446b4453..ea5a729c1b4 100644
21 --- a/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild
22 +++ b/dev-python/flask-mongoengine/flask-mongoengine-1.0.0.ebuild
23 @@ -3,7 +3,7 @@
24
25 EAPI=7
26
27 -PYTHON_COMPAT=( python3_{7..9} )
28 +PYTHON_COMPAT=( python3_{8..10} )
29 inherit distutils-r1
30
31 DESCRIPTION="Flask support for MongoDB and with WTF model forms"
32 @@ -31,35 +31,36 @@ distutils_enable_tests pytest
33 python_prepare_all() {
34 sed -i -e '/addopts/d' setup.cfg || die
35
36 - # fails with mongomock installed
37 - sed -e 's:test_connection__should_parse_mongo_mock_uri:_&:' \
38 - -i tests/test_connection.py || die
39 -
40 distutils-r1_python_prepare_all
41 }
42
43 python_test() {
44 + local EPYTEST_DESELECT=(
45 + # fails with mongomock installed
46 + tests/test_connection.py::test_connection__should_parse_mongo_mock_uri__as_uri_and_as_settings
47 + )
48 local dbpath=${TMPDIR}/mongo.db
49 local logpath=${TMPDIR}/mongod.log
50 + local DB_PORT=27017
51
52 mkdir -p "${dbpath}" || die
53 ebegin "Trying to start mongod on port ${DB_PORT}"
54
55 LC_ALL=C \
56 mongod --dbpath "${dbpath}" --nojournal \
57 - --bind_ip 127.0.0.1 --port 27017 \
58 + --bind_ip 127.0.0.1 --port ${DB_PORT} \
59 --unixSocketPrefix "${TMPDIR}" \
60 --logpath "${logpath}" --fork || die
61 sleep 2
62
63 # Now we need to check if the server actually started...
64 - if [[ -S "${TMPDIR}"/mongodb-27017.sock ]]; then
65 + if [[ -S "${TMPDIR}"/mongodb-${DB_PORT}.sock ]]; then
66 # yay!
67 eend 0
68 else
69 eend 1
70 - eerror "Unable to start mongod for tests. See the server log:"
71 - eerror " ${logpath}"
72 + eerror "Unable to start mongod for tests. Here is the server log:"
73 + cat "${logpath}"
74 die "Unable to start mongod for tests."
75 fi