Flake8 bugbear fixes (#12072)

* Don't use mutable argument defaults (bugbear B006)

* Use callable(x) instead of hasattr(x, '__call__') (bugbear B004)

* Remove/mark unused loop control variables (bugbear B007)

* Fix stripping protocol from kodi host name (bugbear B005)

* Fix plant daily history add default date (bugbear B008)
This commit is contained in:
Ville Skyttä 2018-01-31 00:44:05 +02:00 committed by Paulus Schoutsen
parent 37034a7450
commit cab6c694c5
15 changed files with 23 additions and 22 deletions

View file

@ -135,7 +135,7 @@ class TestHomeAssistant(unittest.TestCase):
"""Test Coro."""
call_count.append('call')
for i in range(3):
for _ in range(3):
self.hass.add_job(test_coro())
run_coroutine_threadsafe(
@ -155,7 +155,7 @@ class TestHomeAssistant(unittest.TestCase):
"""Test Coro."""
call_count.append('call')
for i in range(2):
for _ in range(2):
self.hass.add_job(test_coro())
@asyncio.coroutine
@ -185,7 +185,7 @@ class TestHomeAssistant(unittest.TestCase):
yield from asyncio.sleep(0, loop=self.hass.loop)
yield from asyncio.sleep(0, loop=self.hass.loop)
for i in range(2):
for _ in range(2):
self.hass.add_job(test_executor)
run_coroutine_threadsafe(
@ -210,7 +210,7 @@ class TestHomeAssistant(unittest.TestCase):
yield from asyncio.sleep(0, loop=self.hass.loop)
yield from asyncio.sleep(0, loop=self.hass.loop)
for i in range(2):
for _ in range(2):
self.hass.add_job(test_callback)
run_coroutine_threadsafe(