Commit 9fe8ba12 authored by Jason Madden's avatar Jason Madden

Coverage updates.

parent 6115e431
......@@ -141,14 +141,13 @@ class AbstractLinkable(object):
link = self._links.pop(0) # Cython optimizes using list internals
id_link = id(link)
if id_link in done:
continue
done.add(id_link)
try:
link(self)
except: # pylint:disable=bare-except
# We're running in the hub, errors must not escape.
self.hub.handle_error((link, self), *sys.exc_info())
if id_link not in done:
done.add(id_link)
try:
link(self)
except: # pylint:disable=bare-except
# We're running in the hub, errors must not escape.
self.hub.handle_error((link, self), *sys.exc_info())
if link is final_link:
break
......
......@@ -96,17 +96,20 @@ class TestCExt(greentest.TestCase):
class SwitchWithFixedHash(object):
# Replaces greenlet.switch with a callable object
# with a hash code we control.
# with a hash code we control. This only matters if
# we're hashing this somewhere (which we used to), but
# that doesn't preserve order, so we don't do
# that anymore.
def __init__(self, greenlet, hashcode):
self.switch = greenlet.switch
self.hashcode = hashcode
def __hash__(self):
return self.hashcode
raise AssertionError
def __eq__(self, other):
return self is other
raise AssertionError
def __call__(self, *args, **kwargs):
return self.switch(*args, **kwargs)
......@@ -143,7 +146,7 @@ def acquire_then_spawn(sem, should_quit):
def release_then_spawn(sem, should_quit):
sem.release()
if should_quit:
if should_quit: # pragma: no cover
return
g = FirstG.spawn(acquire_then_spawn, sem, should_quit)
g.join()
......
......@@ -429,9 +429,11 @@ class GreenletTree(object):
self.__render_locals(tree)
try:
self.__render_children(tree)
except RuntimeError:
except RuntimeError: # pragma: no cover
# If the tree is exceptionally deep, we can hit the recursion error.
# Usually it's several levels down so we can make a print call.
# This came up in test__semaphore before TestSemaphoreFair
# was fixed.
print("When rendering children", *sys.exc_info())
return tree.lines
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment