Don't skipTest in unittest.TestCase.setUpClass
resolves an issue where skipping from class setup errors in unittest2 This is reported fixed in unittest2 0.4.2, but seems to be still happening in 1.0.1 https://pypi.python.org/pypi/unittest2#id9
This commit is contained in:
@@ -33,9 +33,8 @@ class ClientWarningTests(unittest.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
if PROTOCOL_VERSION < 4:
|
if PROTOCOL_VERSION < 4:
|
||||||
raise unittest.SkipTest(
|
return
|
||||||
"Native protocol 4,0+ is required for client warnings, currently using %r"
|
|
||||||
% (PROTOCOL_VERSION,))
|
|
||||||
cls.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
|
cls.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
|
||||||
cls.session = cls.cluster.connect()
|
cls.session = cls.cluster.connect()
|
||||||
|
|
||||||
@@ -51,8 +50,17 @@ class ClientWarningTests(unittest.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
|
if PROTOCOL_VERSION < 4:
|
||||||
|
return
|
||||||
|
|
||||||
cls.cluster.shutdown()
|
cls.cluster.shutdown()
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
if PROTOCOL_VERSION < 4:
|
||||||
|
raise unittest.SkipTest(
|
||||||
|
"Native protocol 4,0+ is required for client warnings, currently using %r"
|
||||||
|
% (PROTOCOL_VERSION,))
|
||||||
|
|
||||||
def test_warning_basic(self):
|
def test_warning_basic(self):
|
||||||
"""
|
"""
|
||||||
Test to validate that client warnings can be surfaced
|
Test to validate that client warnings can be surfaced
|
||||||
|
|||||||
@@ -28,14 +28,11 @@ def setup_module():
|
|||||||
|
|
||||||
class CustomPayloadTests(unittest.TestCase):
|
class CustomPayloadTests(unittest.TestCase):
|
||||||
|
|
||||||
@classmethod
|
def setUp(self):
|
||||||
def setUpClass(cls):
|
|
||||||
if PROTOCOL_VERSION < 4:
|
if PROTOCOL_VERSION < 4:
|
||||||
raise unittest.SkipTest(
|
raise unittest.SkipTest(
|
||||||
"Native protocol 4,0+ is required for custom payloads, currently using %r"
|
"Native protocol 4,0+ is required for custom payloads, currently using %r"
|
||||||
% (PROTOCOL_VERSION,))
|
% (PROTOCOL_VERSION,))
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
|
self.cluster = Cluster(protocol_version=PROTOCOL_VERSION)
|
||||||
self.session = self.cluster.connect()
|
self.session = self.cluster.connect()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user