Fix more deprecation warnings (#7778)
* Remove setting up an hbmqtt broker * Don't pass loop to web.Application in tests * Use .query instead of deprecated .GET for aiohttp requests * Fix closing file resource * Do not use asyncio mark * Notify.html5 - PyJWT: Use options to disable verify * Yamaha: Test was still using deprecated ip * Remove pytest-asyncio
This commit is contained in:
1 parent
910020bc5f
commit
e68bd0457c
20 files changed
+22
-26
No files matched your search
@@ -69,7 +69,6 @@ class TestComponentsDeviceTrackerJSONMQTT(unittest.TestCase):
|
||||
topic = 'location/zanzito'
|
||||
location = json.dumps(LOCATION_MESSAGE)
|
||||
|
||||
self.hass.config.components = set(['mqtt_json', 'zone'])
|
||||
assert setup_component(self.hass, device_tracker.DOMAIN, {
|
||||
device_tracker.DOMAIN: {
|
||||
CONF_PLATFORM: 'mqtt_json',
|
||||
@@ -88,7 +87,6 @@ class TestComponentsDeviceTrackerJSONMQTT(unittest.TestCase):
|
||||
topic = 'location/zanzito'
|
||||
location = 'home'
|
||||
|
||||
self.hass.config.components = set(['mqtt_json'])
|
||||
assert setup_component(self.hass, device_tracker.DOMAIN, {
|
||||
device_tracker.DOMAIN: {
|
||||
CONF_PLATFORM: 'mqtt_json',
|
||||
@@ -110,7 +108,6 @@ class TestComponentsDeviceTrackerJSONMQTT(unittest.TestCase):
|
||||
topic = 'location/zanzito'
|
||||
location = json.dumps(LOCATION_MESSAGE_INCOMPLETE)
|
||||
|
||||
self.hass.config.components = set(['mqtt_json'])
|
||||
assert setup_component(self.hass, device_tracker.DOMAIN, {
|
||||
device_tracker.DOMAIN: {
|
||||
CONF_PLATFORM: 'mqtt_json',
|
||||
|
||||
@@ -73,7 +73,7 @@ class TestYamaha(unittest.TestCase):
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
super(TestYamaha, self).setUp()
|
||||
self.rec = FakeYamaha('10.0.0.0')
|
||||
self.rec = FakeYamaha("http://10.0.0.0:80/YamahaRemoteControl/ctrl")
|
||||
|
||||
def test_get_playback_support(self):
|
||||
"""Test the playback."""
|
||||
|
||||
@@ -63,9 +63,9 @@ class TestCommandLine(unittest.TestCase):
|
||||
blocking=True)
|
||||
)
|
||||
|
||||
result = open(filename).read()
|
||||
# the echo command adds a line break
|
||||
self.assertEqual(result, "{}\n".format(message))
|
||||
with open(filename) as fil:
|
||||
# the echo command adds a line break
|
||||
self.assertEqual(fil.read(), "{}\n".format(message))
|
||||
|
||||
@patch('homeassistant.components.notify.command_line._LOGGER.error')
|
||||
def test_error_for_none_zero_exit_code(self, mock_error):
|
||||
|
||||
Reference in new issue
Block a user