Lazy initialise the worker pool (#4110)
* Lazy initialise the worker pool * Minimize pool initialization in core tests * Fix tests on Python 3.4 * Remove passing in thread count to mock HASS * Tests: Allow pool by default for threaded, disable for async * Remove JobPriority for thread pool * Fix wrong block_till_done * EmulatedHue: Remove unused test code * Zigbee: do not touch hass.pool * Init loop in add_job * Fix core test * Fix random sensor test
This commit is contained in:
1 parent
a1e910f1cf
commit
7f699b4261
26 files changed
+140
-185
No files matched your search
@@ -178,7 +178,7 @@ class EmailContentSensor(unittest.TestCase):
|
||||
sensor.entity_id = "sensor.emailtest"
|
||||
sensor.update()
|
||||
|
||||
self.hass.pool.block_till_done()
|
||||
self.hass.block_till_done()
|
||||
states_received.wait(5)
|
||||
|
||||
self.assertEqual("Test Message", states[0].state)
|
||||
|
||||
@@ -33,4 +33,4 @@ class TestRandomSensor(unittest.TestCase):
|
||||
state = self.hass.states.get('sensor.test')
|
||||
|
||||
self.assertLessEqual(int(state.state), config['sensor']['maximum'])
|
||||
self.assertGreater(int(state.state), config['sensor']['minimum'])
|
||||
self.assertGreaterEqual(int(state.state), config['sensor']['minimum'])
|
||||
@@ -16,7 +16,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant(0)
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.components = ['rfxtrx']
|
||||
|
||||
def tearDown(self):
|
||||
|
||||
Reference in new issue
Block a user