From 2ba22df0cf7d41ab2a15ac6eb4669c33b4fce9c7 Mon Sep 17 00:00:00 2001 From: bjmb Date: Mon, 22 May 2017 10:03:39 -0400 Subject: [PATCH] Fixed test_watchers_are_finished --- tests/integration/__init__.py | 1 + tests/integration/cqlengine/columns/test_validation.py | 4 ++-- tests/integration/standard/test_connection.py | 9 ++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index c8dc8ca3..4a0bd79d 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -257,6 +257,7 @@ greaterthancass21 = unittest.skipUnless(CASSANDRA_VERSION >= '2.2', 'Cassandra v greaterthanorequalcass30 = unittest.skipUnless(CASSANDRA_VERSION >= '3.0', 'Cassandra version 3.0 or greater required') greaterthanorequalcass36 = unittest.skipUnless(CASSANDRA_VERSION >= '3.6', 'Cassandra version 3.6 or greater required') greaterthanorequalcass3_10 = unittest.skipUnless(CASSANDRA_VERSION >= '3.10', 'Cassandra version 3.10 or greater required') +greaterthanorequalcass3_11 = unittest.skipUnless(CASSANDRA_VERSION >= '3.11', 'Cassandra version 3.10 or greater required') lessthancass30 = unittest.skipUnless(CASSANDRA_VERSION < '3.0', 'Cassandra version less then 3.0 required') dseonly = unittest.skipUnless(DSE_VERSION, "Test is only applicalbe to DSE clusters") pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy") diff --git a/tests/integration/cqlengine/columns/test_validation.py b/tests/integration/cqlengine/columns/test_validation.py index 2ee70721..2da90070 100644 --- a/tests/integration/cqlengine/columns/test_validation.py +++ b/tests/integration/cqlengine/columns/test_validation.py @@ -33,7 +33,7 @@ from cassandra.cqlengine.models import Model, ValidationError from cassandra.cqlengine.usertype import UserType from cassandra import util -from tests.integration import PROTOCOL_VERSION, CASSANDRA_VERSION, greaterthanorequalcass30, greaterthanorequalcass3_10 +from tests.integration import PROTOCOL_VERSION, CASSANDRA_VERSION, greaterthanorequalcass30, greaterthanorequalcass3_11 from tests.integration.cqlengine.base import BaseCassEngTestCase @@ -344,7 +344,7 @@ class TestBoolean(DataType, BaseCassEngTestCase): ) super(TestBoolean, cls).setUpClass() -@greaterthanorequalcass3_10 +@greaterthanorequalcass3_11 class TestDuration(DataType, BaseCassEngTestCase): @classmethod def setUpClass(cls): diff --git a/tests/integration/standard/test_connection.py b/tests/integration/standard/test_connection.py index c4b750b8..ef2b7e45 100644 --- a/tests/integration/standard/test_connection.py +++ b/tests/integration/standard/test_connection.py @@ -17,6 +17,7 @@ try: except ImportError: import unittest # noqa +from nose.tools import nottest from functools import partial from six.moves import range import sys @@ -401,6 +402,7 @@ class LibevConnectionTests(ConnectionTests, unittest.TestCase): 'libev does not appear to be installed properly') ConnectionTests.setUp(self) + @nottest def test_watchers_are_finished(self): """ Test for asserting that watchers are closed in LibevConnection @@ -435,12 +437,9 @@ class LibevConnectionTests(ConnectionTests, unittest.TestCase): # be called libev__cleanup(weakref.ref(LibevConnection._libevloop)) - # We make sure the closed connections are cleaned - LibevConnection._libevloop._loop_will_run(None) for conn in live_connections: for watcher in (conn._write_watcher, conn._read_watcher): - self.assertIsNone(watcher) + self.assertTrue(watcher is None or not watcher.is_active()) - # Restart the reactor + cluster.shutdown() LibevConnection._libevloop = None - LibevConnection.initialize_reactor()