[Python-modules-team] Bug#950841: radon fails autopkg tests with python3.8, fixed in new upstream 4.1.0
Matthias Klose
doko at debian.org
Fri Feb 7 10:45:59 GMT 2020
Package: src:radon
Version: 3.0.3+dfsg-1
Severity: serious
Tags: sid bullseye
User: debian-python at lists.debian.org
Usertags: python3.8
radon fails autopkg tests with python3.8, apparently fixed in new upstream 4.1.0.
[...]
=================================== FAILURES ===================================
____ test_visitor[\n a += 3\n b += 4\n c *= 3\n -expected7] ____
code = '\n a += 3\n b += 4\n c *= 3\n ', expected = (3, 6, 2, 5)
@pytest.mark.parametrize('code,expected', SIMPLE_BLOCKS)
def test_visitor(code, expected):
visitor = HalsteadVisitor.from_code(dedent(code))
> assert expected == (visitor.operators, visitor.operands,
visitor.distinct_operators, visitor.distinct_operands)
E assert (3, 6, 2, 5) == (3, 6, 2, 6)
E At index 3 diff: 5 != 6
E Use -v to get the full diff
radon/tests/test_halstead.py:71: AssertionError
_ test_visitor[\n a = b < 4\n c = i <= 45 >= d\n k = 4 < 2\n
-expected9] _
code = '\n a = b < 4\n c = i <= 45 >= d\n k = 4 < 2\n '
expected = (4, 7, 3, 6)
@pytest.mark.parametrize('code,expected', SIMPLE_BLOCKS)
def test_visitor(code, expected):
visitor = HalsteadVisitor.from_code(dedent(code))
> assert expected == (visitor.operators, visitor.operands,
visitor.distinct_operators, visitor.distinct_operands)
E assert (4, 7, 3, 6) == (4, 7, 3, 7)
E At index 3 diff: 6 != 7
E Use -v to get the full diff
radon/tests/test_halstead.py:71: AssertionError
_ test_mi_visit[\n class A(object):\n\n def __init__(self, n):\n
# this is awesome\n self.n = sum(i for i in range(n) if
i&1)\n\n def m(self, j):\n """Just compute it.\n
Example.\n """\n if j > 421:\n return
(self.n + 2) ** j\n return (self.n - 2) ** j\n\n a = A(4)\n
a.m(42) # i don't know why, but it works\n-93.84027450359395-True] _
code = "class A(object):\n\n def __init__(self, n):\n # this is
awesome\n self.n = sum(i for i in range(n) i... return (self.n + 2)
** j\n return (self.n - 2) ** j\n\na = A(4)\na.m(42) # i don't know why,
but it works"
expected = 93.84027450359395, count_multi = True
@pytest.mark.parametrize('code,expected,count_multi', MI_VISIT_CASES)
def test_mi_visit(code, expected, count_multi):
code = dedent(code)
expected = expected
count_multi = count_multi
> assert mi_visit(code, count_multi) == expected
E assert 93.75365939134126 == 93.84027450359395
E + where 93.75365939134126 = mi_visit("class A(object):\n\n def
__init__(self, n):\n # this is awesome\n self.n = sum(i for i in
range(n) i... return (self.n + 2) ** j\n return (self.n - 2) **
j\n\na = A(4)\na.m(42) # i don't know why, but it works", True)
radon/tests/test_other_metrics.py:130: AssertionError
_ test_mi_visit[\n class A(object):\n\n def __init__(self, n):\n
# this is awesome\n self.n = sum(i for i in range(n) if
i&1)\n\n def m(self, j):\n """Just compute it.\n
Example.\n """\n if j > 421:\n return
(self.n + 2) ** j\n return (self.n - 2) ** j\n\n a = A(4)\n
a.m(42) # i don't know why, but it works\n-88.84176333569131-False] _
code = "class A(object):\n\n def __init__(self, n):\n # this is
awesome\n self.n = sum(i for i in range(n) i... return (self.n + 2)
** j\n return (self.n - 2) ** j\n\na = A(4)\na.m(42) # i don't know why,
but it works"
expected = 88.84176333569131, count_multi = False
@pytest.mark.parametrize('code,expected,count_multi', MI_VISIT_CASES)
def test_mi_visit(code, expected, count_multi):
code = dedent(code)
expected = expected
count_multi = count_multi
> assert mi_visit(code, count_multi) == expected
E assert 88.75514822343865 == 88.84176333569131
E + where 88.75514822343865 = mi_visit("class A(object):\n\n def
__init__(self, n):\n # this is awesome\n self.n = sum(i for i in
range(n) i... return (self.n + 2) ** j\n return (self.n - 2) **
j\n\na = A(4)\na.m(42) # i don't know why, but it works", False)
radon/tests/test_other_metrics.py:130: AssertionError
===================== 4 failed, 382 passed in 0.74 seconds =====================
More information about the Python-modules-team
mailing list