diff options
author | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-06 14:09:16 -0800 |
---|---|---|
committer | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-06 15:14:51 -0800 |
commit | c11ff042bfffa9221220b41ca6754842b273d903 (patch) | |
tree | 3ee2f67c2cda9561a5d1a3d607945dd7d7f91c1e /test/test_integration.py | |
parent | d736d0b0746dc05046550f077698da45ec620157 (diff) | |
download | kafka-python-c11ff042bfffa9221220b41ca6754842b273d903.tar.gz |
Make kafka brokers per-test in failover integration tests
This is better since the tests stop/start brokers, and if something goes wrong
they can affect eachother.
Diffstat (limited to 'test/test_integration.py')
-rw-r--r-- | test/test_integration.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/test/test_integration.py b/test/test_integration.py index f638956..ccf9990 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -802,25 +802,23 @@ class TestConsumer(unittest.TestCase): class TestFailover(unittest.TestCase): - @classmethod - def setUpClass(cls): + def setUp(self): - zk_chroot = random_string(10) + zk_chroot = random_string(10) replicas = 2 partitions = 2 # mini zookeeper, 2 kafka brokers - cls.zk = ZookeeperFixture.instance() - kk_args = [cls.zk.host, cls.zk.port, zk_chroot, replicas, partitions] - cls.brokers = [KafkaFixture.instance(i, *kk_args) for i in range(replicas)] - cls.client = KafkaClient(cls.brokers[0].host, cls.brokers[0].port) - - @classmethod - def tearDownClass(cls): - cls.client.close() - for broker in cls.brokers: + self.zk = ZookeeperFixture.instance() + kk_args = [self.zk.host, self.zk.port, zk_chroot, replicas, partitions] + self.brokers = [KafkaFixture.instance(i, *kk_args) for i in range(replicas)] + self.client = KafkaClient(self.brokers[0].host, self.brokers[0].port) + + def tearDown(self): + self.client.close() + for broker in self.brokers: broker.close() - cls.zk.close() + self.zk.close() def test_switch_leader(self): |