Bug#904655: python-line-profiler ftbfs with Python 3.7

Matthias Klose doko at debian.org
Thu Jul 26 10:23:56 BST 2018


Package: src:python-line-profiler
Version: 2.1-1
Severity: serious
Tags: sid buster

python-line-profiler ftbfs with Python 3.7:

============================= test session starts ==============================
platform linux -- Python 3.7.0+, pytest-3.6.2, py-1.5.3, pluggy-0.6.0
rootdir: /home/packages/tmp/python-line-profiler-2.1, inifile:
plugins: hypothesis-3.44.1, case-1.5.3
collected 8 items

tests/test_kernprof.py ...F                                              [ 50%]
tests/test_line_profiler.py ..F.                                         [100%]

=================================== FAILURES ===================================
_______________________ TestKernprof.test_gen_decorator ________________________

args = (10,), kwds = {}, g = <generator object g at 0x7f66663eed68>, item = 50
input = None

    @functools.wraps(func)
    def wrapper(*args, **kwds):
        g = func(*args, **kwds)
        # The first iterate will not be a .send()
        self.enable_by_count()
        try:
            item = next(g)
        finally:
            self.disable_by_count()
        input = (yield item)
        # But any following one might be.
        while True:
            self.enable_by_count()
            try:
>               item = g.send(input)
E               StopIteration

kernprof.py:104: StopIteration

The above exception was the direct cause of the following exception:

self = <test_kernprof.TestKernprof testMethod=test_gen_decorator>

    def test_gen_decorator(self):
        profile = ContextualProfile()
        g_wrapped = profile(g)
        self.assertEqual(g_wrapped.__name__, g.__name__)
        self.assertEqual(g_wrapped.__doc__, g.__doc__)

        self.assertEqual(profile.enable_count, 0)
        i = g_wrapped(10)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(next(i), 20)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(i.send(30), 50)
        self.assertEqual(profile.enable_count, 0)
        with self.assertRaises(StopIteration):
>           next(i)
E           RuntimeError: generator raised StopIteration

tests/test_kernprof.py:77: RuntimeError
_____________________ TestLineProfiler.test_gen_decorator ______________________

args = (10,), kwds = {}, g = <generator object g at 0x7f66663e1750>, item = 50
input = None

    @functools.wraps(func)
    def wrapper(*args, **kwds):
        g = func(*args, **kwds)
        # The first iterate will not be a .send()
        self.enable_by_count()
        try:
            item = next(g)
        finally:
            self.disable_by_count()
        input = (yield item)
        # But any following one might be.
        while True:
            self.enable_by_count()
            try:
>               item = g.send(input)
E               StopIteration

line_profiler.py:102: StopIteration

The above exception was the direct cause of the following exception:

self = <test_line_profiler.TestLineProfiler testMethod=test_gen_decorator>

    def test_gen_decorator(self):
        profile = LineProfiler()
        g_wrapped = profile(g)
        self.assertEqual(g_wrapped.__name__, 'g')
        timings = profile.code_map[g.__code__]

        self.assertEqual(profile.enable_count, 0)
        i = g_wrapped(10)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(next(i), 20)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(len(timings), 1)
        self.assertEqual(i.send(30), 50)
        self.assertEqual(profile.enable_count, 0)
        self.assertEqual(len(timings), 2)
        with self.assertRaises(StopIteration):
>           next(i)
E           RuntimeError: generator raised StopIteration

tests/test_line_profiler.py:94: RuntimeError
====================== 2 failed, 6 passed in 0.24 seconds ======================



More information about the debian-science-maintainers mailing list