commit:     42b115dca716457c445021b9d026d79d8869e553
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 05:17:29 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 05:17:29 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42b115dc

dev-python/configobj: run tests via pytest instead

Upstream make use of some Pytest-specific functionality.
We adjust the patch accordingly.

Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/configobj/configobj-5.0.6-r1.ebuild     |  4 +--
 .../files/configobj-5.0.6-fix-py2-tests.patch      | 35 +++++++---------------
 2 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/dev-python/configobj/configobj-5.0.6-r1.ebuild 
b/dev-python/configobj/configobj-5.0.6-r1.ebuild
index 469eee85be8..c530f28451b 100644
--- a/dev-python/configobj/configobj-5.0.6-r1.ebuild
+++ b/dev-python/configobj/configobj-5.0.6-r1.ebuild
@@ -20,6 +20,4 @@ RDEPEND="dev-python/six[${PYTHON_USEDEP}]"
 
 PATCHES=( "${FILESDIR}/${P}-fix-py2-tests.patch" )
 
-python_test() {
-       "${EPYTHON}" validate.py -v || die "Tests fail with ${EPYTHON}"
-}
+distutils_enable_tests pytest

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
index 5ac64a256cb..49576b4f43e 100644
--- 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
@@ -1,9 +1,16 @@
-Upstream: 
https://github.com/DiffSK/configobj/commit/e2731538d1a37a5b67a6e518848be6a8988043ae
-
 diff --git a/tests/test_validate.py b/tests/test_validate.py
-index bffb0dc..4eed7e9 100644
+index bffb0dc..c7d57d3 100644
 --- a/tests/test_validate.py
 +++ b/tests/test_validate.py
+@@ -2,7 +2,7 @@
+ 
+ from configobj import ConfigObj
+ import pytest
+-from validate import Validator, VdtValueTooSmallError
++from validate import Validator, VdtValueTooSmallError, dottedQuadToNum
+ 
+ 
+ class TestBasic(object):
 @@ -161,3 +161,26 @@ class TestBasic(object):
                      'test3': 3,
                      'test4': 6.0
@@ -31,25 +38,3 @@ index bffb0dc..4eed7e9 100644
 +        with pytest.raises(ValueError) as excinfo:
 +            dottedQuadToNum('-1')
 +        assert str(excinfo.value) == 'Not a good dotted-quad IP: -1'
-diff --git a/validate.py b/validate.py
-index b7a964c..9d8c94d 100644
---- a/validate.py
-+++ b/validate.py
-@@ -277,17 +277,8 @@ def dottedQuadToNum(ip):
-     
-     >>> int(dottedQuadToNum('1 '))
-     1
--    >>> int(dottedQuadToNum(' 1.2'))
--    16777218
--    >>> int(dottedQuadToNum(' 1.2.3 '))
--    16908291
-     >>> int(dottedQuadToNum('1.2.3.4'))
-     16909060
--    >>> dottedQuadToNum('255.255.255.255')
--    4294967295
--    >>> dottedQuadToNum('255.255.255.256')
--    Traceback (most recent call last):
--    ValueError: Not a good dotted-quad IP: 255.255.255.256
-     """
-     
-     # import here to avoid it when ip_addr values are not used

Reply via email to