diff --git a/tests/components/notify/test_apns.py b/tests/components/notify/test_apns.py index 0bd0333a6fb..7715ff168be 100644 --- a/tests/components/notify/test_apns.py +++ b/tests/components/notify/test_apns.py @@ -3,7 +3,6 @@ import io import unittest from unittest.mock import Mock, patch, mock_open -from apns2.errors import Unregistered import yaml import homeassistant.components.notify as notify @@ -359,6 +358,8 @@ class TestApns(unittest.TestCase): @patch('homeassistant.components.notify.apns._write_device') def test_disable_when_unregistered(self, mock_write, mock_client): """Test disabling a device when it is unregistered.""" + from apns2.errors import Unregistered + send = mock_client.return_value.send_notification send.side_effect = Unregistered() diff --git a/tests/test_core.py b/tests/test_core.py index 67ae849b022..ea952a7c073 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -797,8 +797,10 @@ class TestConfig(unittest.TestCase): def test_is_allowed_path(self): """Test is_allowed_path method.""" with TemporaryDirectory() as tmp_dir: + # The created dir is in /tmp. This is a symlink on OS X + # causing this test to fail unless we resolve path first. self.config.whitelist_external_dirs = set(( - tmp_dir, + os.path.realpath(tmp_dir), )) test_file = os.path.join(tmp_dir, "test.jpg")