Issue #21205: Fix unit tests

This commit is contained in:
Victor Stinner 2014-06-16 16:21:57 +02:00
parent 40ee30181f
commit 7db27c8ed6
2 changed files with 2 additions and 5 deletions

View File

@ -154,10 +154,7 @@ class TaskTests(unittest.TestCase):
t = MyTask(gen, loop=self.loop) t = MyTask(gen, loop=self.loop)
filename = gen.gi_code.co_filename filename = gen.gi_code.co_filename
lineno = gen.gi_frame.f_lineno lineno = gen.gi_frame.f_lineno
# FIXME: check for the name "coro" instead of "notmuch" because self.assertEqual(repr(t), 'T[](<notmuch at %s:%s>)' % (filename, lineno))
# @asyncio.coroutine drops the name of the wrapped function:
# http://bugs.python.org/issue21205
self.assertEqual(repr(t), 'T[](<coro at %s:%s>)' % (filename, lineno))
def test_task_basics(self): def test_task_basics(self):
@asyncio.coroutine @asyncio.coroutine

View File

@ -885,7 +885,7 @@ class SizeofTest(unittest.TestCase):
check(bar, size('PP')) check(bar, size('PP'))
# generator # generator
def get_gen(): yield 1 def get_gen(): yield 1
check(get_gen(), size('Pb2P')) check(get_gen(), size('Pb2PPP'))
# iterator # iterator
check(iter('abc'), size('lP')) check(iter('abc'), size('lP'))
# callable-iterator # callable-iterator