diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2017-12-07 15:07:31 -0800 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2017-12-07 18:45:42 -0800 |
commit | 43511aa7fac950e07376872443db133cbb21530c (patch) | |
tree | 50bf55ebe41bb457906cabc575c6c2d12da630e3 /test | |
parent | 009290ddd5d4616d70bff93f841e773af8b22750 (diff) | |
download | kafka-python-minor-exception-cleanup.tar.gz |
Minor Exception cleanupminor-exception-cleanup
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures.py | 4 | ||||
-rw-r--r-- | test/test_failover_integration.py | 2 | ||||
-rw-r--r-- | test/testutil.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/test/fixtures.py b/test/fixtures.py index 661a631..b49a160 100644 --- a/test/fixtures.py +++ b/test/fixtures.py @@ -162,7 +162,7 @@ class ZookeeperFixture(Fixture): time.sleep(backoff) tries += 1 else: - raise Exception('Failed to start Zookeeper before max_timeout') + raise RuntimeError('Failed to start Zookeeper before max_timeout') self.out("Done!") atexit.register(self.close) @@ -302,7 +302,7 @@ class KafkaFixture(Fixture): time.sleep(backoff) tries += 1 else: - raise Exception('Failed to start KafkaInstance before max_timeout') + raise RuntimeError('Failed to start KafkaInstance before max_timeout') self.out("Done!") self.running = True atexit.register(self.close) diff --git a/test/test_failover_integration.py b/test/test_failover_integration.py index 2439b58..9141947 100644 --- a/test/test_failover_integration.py +++ b/test/test_failover_integration.py @@ -197,7 +197,7 @@ class TestFailover(KafkaIntegrationTestCase): while True: try: producer.send_messages(topic, partition, msg.encode('utf-8')) - except: + except Exception: log.exception('failure in _send_random_messages - retrying') continue else: diff --git a/test/testutil.py b/test/testutil.py index c247e6a..0bacac4 100644 --- a/test/testutil.py +++ b/test/testutil.py @@ -113,7 +113,7 @@ class KafkaIntegrationTestCase(unittest.TestCase): def current_offset(self, topic, partition): try: offsets, = self.client.send_offset_request([OffsetRequestPayload(topic, partition, -1, 1)]) - except: + except Exception: # XXX: We've seen some UnknownErrors here and can't debug w/o server logs self.zk.child.dump_logs() self.server.child.dump_logs() |