Skip to content

Commit 8025dc6

Browse files
author
bjmb
committed
Skipped some tests if LibevConnection is not installed
1 parent 1e7c0cb commit 8025dc6

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tests/unit/test_cluster.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
except ImportError:
3434
LibevConnection = None # noqa
3535

36-
def setUp():
37-
LibevConnection.initialize_reactor()
38-
3936

4037
class ExceptionTypeTest(unittest.TestCase):
4138

@@ -131,6 +128,11 @@ def test_event_delay_timing(self, *_):
131128

132129

133130
class SessionTest(unittest.TestCase):
131+
def setUp(self):
132+
if LibevConnection is None:
133+
raise unittest.SkipTest('libev does not appear to be installed correctly')
134+
LibevConnection.initialize_reactor()
135+
134136
# TODO: this suite could be expanded; for now just adding a test covering a PR
135137
@mock_session_pools
136138
def test_default_serial_consistency_level(self, *_):
@@ -161,6 +163,10 @@ def test_default_serial_consistency_level(self, *_):
161163

162164

163165
class ExecutionProfileTest(unittest.TestCase):
166+
def setUp(self):
167+
if LibevConnection is None:
168+
raise unittest.SkipTest('libev does not appear to be installed correctly')
169+
LibevConnection.initialize_reactor()
164170

165171
def _verify_response_future_profile(self, rf, prof):
166172
self.assertEqual(rf._load_balancer, prof.load_balancing_policy)

0 commit comments

Comments
 (0)