diff --git a/tests/broker/test_broker.py b/tests/broker/test_broker.py index b2ba279..ccd0ac4 100644 --- a/tests/broker/test_broker.py +++ b/tests/broker/test_broker.py @@ -1,5 +1,6 @@ import tempfile import time +import typing import unittest import unittest.mock @@ -9,7 +10,13 @@ import sergeant.objects -class BrokerTestCase: +class BrokerTestCase( + unittest.TestCase, +): + __test__ = False + + test_broker: sergeant.broker.Broker + test_brokers: typing.List[sergeant.broker.Broker] tasks = [ sergeant.objects.Task( kwargs={ @@ -567,8 +574,9 @@ def test_lock( class RedisSingleServerBrokerTestCase( BrokerTestCase, - unittest.TestCase, ): + __test__ = True + @classmethod def setUpClass( cls, @@ -613,8 +621,9 @@ def setUpClass( class RedisMultipleServerBrokerTestCase( BrokerTestCase, - unittest.TestCase, ): + __test__ = True + @classmethod def setUpClass( cls, @@ -665,8 +674,9 @@ def setUpClass( class MongoSingleServerConnectorTestCase( BrokerTestCase, - unittest.TestCase, ): + __test__ = True + @classmethod def setUpClass( cls, @@ -710,8 +720,9 @@ def setUpClass( class MongoMultipleServersConnectorTestCase( BrokerTestCase, - unittest.TestCase, ): + __test__ = True + @classmethod def setUpClass( cls, @@ -760,8 +771,9 @@ def setUpClass( class LocalBrokerTestCase( BrokerTestCase, - unittest.TestCase, ): + __test__ = True + @classmethod def setUpClass( cls, diff --git a/tests/connector/test_connector.py b/tests/connector/test_connector.py index 63f73f2..98797db 100644 --- a/tests/connector/test_connector.py +++ b/tests/connector/test_connector.py @@ -5,7 +5,12 @@ import sergeant.connector -class ConnectorTestCase: +class ConnectorTestCase( + unittest.TestCase, +): + __test__ = False + + connector: sergeant.connector._connector.Connector test_queue_name = 'test_queue_name' test_queue_item = b'test_queue_item' test_queue_items = [ @@ -668,8 +673,9 @@ def test_queue_consumable( class RedisSingleServerConnectorTestCase( ConnectorTestCase, - unittest.TestCase, ): + __test__ = True + def setUp( self, ): @@ -687,8 +693,9 @@ def setUp( class RedisMultipleServersConnectorTestCase( ConnectorTestCase, - unittest.TestCase, ): + __test__ = True + def setUp( self, ): @@ -712,8 +719,9 @@ def setUp( class MongoSingleServerConnectorTestCase( ConnectorTestCase, - unittest.TestCase, ): + __test__ = True + def setUp( self, ): @@ -730,8 +738,9 @@ def setUp( class MongoMultipleServersConnectorTestCase( ConnectorTestCase, - unittest.TestCase, ): + __test__ = True + def setUp( self, ): @@ -753,8 +762,9 @@ def setUp( class LocalConnectorTestCase( ConnectorTestCase, - unittest.TestCase, ): + __test__ = True + def setUp( self, ): diff --git a/tests/worker/test_initializers.py b/tests/worker/test_initializers.py index 612e070..082bed3 100644 --- a/tests/worker/test_initializers.py +++ b/tests/worker/test_initializers.py @@ -1,6 +1,11 @@ import unittest import unittest.mock +import sergeant.broker +import sergeant.config +import sergeant.connector +import sergeant.encoder +import sergeant.logging import sergeant.worker @@ -13,10 +18,6 @@ def test_init_logger( worker = sergeant.worker.Worker() worker.config = sergeant.config.WorkerConfig( name='some_worker', - connector=sergeant.config.Connector( - type='', - params={}, - ), ) worker.init_logger() @@ -26,10 +27,6 @@ def test_init_logger( worker.config = sergeant.config.WorkerConfig( name='some_worker', - connector=sergeant.config.Connector( - type='', - params={}, - ), logging=sergeant.config.Logging( handlers=[ sergeant.logging.logstash.LogstashHandler( @@ -214,10 +211,6 @@ def test_init_executor( worker = sergeant.worker.Worker() worker.config = sergeant.config.WorkerConfig( name='some_worker', - connector=sergeant.config.Connector( - type='', - params={}, - ), ) worker.init_executor() self.assertIsInstance( @@ -227,10 +220,6 @@ def test_init_executor( worker.config = sergeant.config.WorkerConfig( name='some_worker', - connector=sergeant.config.Connector( - type='', - params={}, - ), number_of_threads=1, ) worker.init_executor() @@ -241,10 +230,6 @@ def test_init_executor( worker.config = sergeant.config.WorkerConfig( name='some_worker', - connector=sergeant.config.Connector( - type='', - params={}, - ), number_of_threads=2, ) worker.init_executor()