Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/configobj/files/, dev-python/configobj/
Date: Wed, 05 Aug 2020 05:17:42
Message-Id: 1596604649.42b115dca716457c445021b9d026d79d8869e553.sam@gentoo
1 commit: 42b115dca716457c445021b9d026d79d8869e553
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 5 05:17:29 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 5 05:17:29 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42b115dc
7
8 dev-python/configobj: run tests via pytest instead
9
10 Upstream make use of some Pytest-specific functionality.
11 We adjust the patch accordingly.
12
13 Package-Manager: Portage-3.0.1, Repoman-2.3.23
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 dev-python/configobj/configobj-5.0.6-r1.ebuild | 4 +--
17 .../files/configobj-5.0.6-fix-py2-tests.patch | 35 +++++++---------------
18 2 files changed, 11 insertions(+), 28 deletions(-)
19
20 diff --git a/dev-python/configobj/configobj-5.0.6-r1.ebuild b/dev-python/configobj/configobj-5.0.6-r1.ebuild
21 index 469eee85be8..c530f28451b 100644
22 --- a/dev-python/configobj/configobj-5.0.6-r1.ebuild
23 +++ b/dev-python/configobj/configobj-5.0.6-r1.ebuild
24 @@ -20,6 +20,4 @@ RDEPEND="dev-python/six[${PYTHON_USEDEP}]"
25
26 PATCHES=( "${FILESDIR}/${P}-fix-py2-tests.patch" )
27
28 -python_test() {
29 - "${EPYTHON}" validate.py -v || die "Tests fail with ${EPYTHON}"
30 -}
31 +distutils_enable_tests pytest
32
33 diff --git a/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch b/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch
34 index 5ac64a256cb..49576b4f43e 100644
35 --- a/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch
36 +++ b/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch
37 @@ -1,9 +1,16 @@
38 -Upstream: https://github.com/DiffSK/configobj/commit/e2731538d1a37a5b67a6e518848be6a8988043ae
39 -
40 diff --git a/tests/test_validate.py b/tests/test_validate.py
41 -index bffb0dc..4eed7e9 100644
42 +index bffb0dc..c7d57d3 100644
43 --- a/tests/test_validate.py
44 +++ b/tests/test_validate.py
45 +@@ -2,7 +2,7 @@
46 +
47 + from configobj import ConfigObj
48 + import pytest
49 +-from validate import Validator, VdtValueTooSmallError
50 ++from validate import Validator, VdtValueTooSmallError, dottedQuadToNum
51 +
52 +
53 + class TestBasic(object):
54 @@ -161,3 +161,26 @@ class TestBasic(object):
55 'test3': 3,
56 'test4': 6.0
57 @@ -31,25 +38,3 @@ index bffb0dc..4eed7e9 100644
58 + with pytest.raises(ValueError) as excinfo:
59 + dottedQuadToNum('-1')
60 + assert str(excinfo.value) == 'Not a good dotted-quad IP: -1'
61 -diff --git a/validate.py b/validate.py
62 -index b7a964c..9d8c94d 100644
63 ---- a/validate.py
64 -+++ b/validate.py
65 -@@ -277,17 +277,8 @@ def dottedQuadToNum(ip):
66 -
67 - >>> int(dottedQuadToNum('1 '))
68 - 1
69 -- >>> int(dottedQuadToNum(' 1.2'))
70 -- 16777218
71 -- >>> int(dottedQuadToNum(' 1.2.3 '))
72 -- 16908291
73 - >>> int(dottedQuadToNum('1.2.3.4'))
74 - 16909060
75 -- >>> dottedQuadToNum('255.255.255.255')
76 -- 4294967295
77 -- >>> dottedQuadToNum('255.255.255.256')
78 -- Traceback (most recent call last):
79 -- ValueError: Not a good dotted-quad IP: 255.255.255.256
80 - """
81 -
82 - # import here to avoid it when ip_addr values are not used