File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828except ImportError :
2929 EventletConnection = None # noqa
3030
31+ skip_condition = EventletConnection is None or MONKEY_PATCH_LOOP != "eventlet"
3132# There are some issues with some versions of pypy and eventlet
3233@notpypy
33- @unittest .skipIf (EventletConnection is None , "Skpping the eventlet tests because it's not installed" )
34+ @unittest .skipIf (skip_condition , "Skipping the eventlet tests because it's not installed" )
3435@notmonkeypatch
3536class EventletTimerTest (unittest .TestCase , TimerConnectionTests ):
3637 @classmethod
3738 def setUpClass (cls ):
3839 # This is run even though the class is skipped, so we need
3940 # to make sure no monkey patching is happening
40- if not MONKEY_PATCH_LOOP :
41+ if skip_condition :
4142 return
4243
4344 # This is being added temporarily due to a bug in eventlet:
Original file line number Diff line number Diff line change 2727 GeventConnection = None # noqa
2828
2929
30- @unittest .skipIf (GeventConnection is None , "Skpping the gevent tests because it's not installed" )
30+ skip_condition = GeventConnection is None or MONKEY_PATCH_LOOP != "gevent"
31+ @unittest .skipIf (skip_condition , "Skipping the gevent tests because it's not installed" )
3132@notmonkeypatch
3233class GeventTimerTest (unittest .TestCase , TimerConnectionTests ):
3334 @classmethod
3435 def setUpClass (cls ):
3536 # This is run even though the class is skipped, so we need
3637 # to make sure no monkey patching is happening
37- if not MONKEY_PATCH_LOOP :
38+ if skip_condition :
3839 return
3940 gevent .monkey .patch_all ()
4041 cls .connection_class = GeventConnection
Original file line number Diff line number Diff line change @@ -377,11 +377,11 @@ def test_warning_on_no_lbp_with_contact_points(self):
377377 @test_category configuration
378378 """
379379 with patch ('cassandra.cluster.log' ) as patched_logger :
380- Cluster (contact_points = ['1' ])
380+ Cluster (contact_points = ['127.0.0. 1' ])
381381 patched_logger .warn .assert_called_once ()
382382 warning_message = patched_logger .warn .call_args [0 ][0 ]
383383 self .assertIn ('no load_balancing_policy' , warning_message )
384- self .assertIn ("contact_points = ['1']" , warning_message )
384+ self .assertIn ("contact_points = ['127.0.0. 1']" , warning_message )
385385 self .assertIn ('lbp = None' , warning_message )
386386
387387 @mock_session_pools
@@ -397,5 +397,5 @@ def test_no_warning_on_contact_points_with_lbp(self):
397397 @test_category configuration
398398 """
399399 with patch ('cassandra.cluster.log' ) as patched_logger :
400- Cluster (contact_points = ['1' ], load_balancing_policy = object ())
400+ Cluster (contact_points = ['127.0.0. 1' ], load_balancing_policy = object ())
401401 patched_logger .warn .assert_not_called ()
You can’t perform that action at this time.
0 commit comments