Beispiel #1
0
def test_inherit_policy_changing_parent():
    gossip.define("group.hook")
    group = gossip.get_group("group")
    for policy in (gossip.RaiseImmediately(), gossip.RaiseDefer(),
                   gossip.IgnoreExceptions()):
        gossip.set_exception_policy(policy)
        assert group.get_exception_policy() is policy
Beispiel #2
0
def gossip_raise_immediately():
    g = gossip.get_group('slash')
    prev = g.get_exception_policy()
    g.set_exception_policy(gossip.RaiseImmediately())
    try:
        yield
    finally:
        g.set_exception_policy(prev)
Beispiel #3
0
 def setUp(self):
     super(TestCase, self).setUp()
     self._handler = LoggingHandler()
     self._handler.push_application()
     self.addCleanup(self._handler.pop_application)
     gossip.get_group('slash').set_exception_policy(
         gossip.RaiseImmediately())
     self.override_config("log.console_level",
                          10000)  # silence console in tests