From 5659ce3ba106ed8d3a5fedfd0009a763c04d8dce Mon Sep 17 00:00:00 2001 From: "firstof9@gmail.com" Date: Mon, 12 Feb 2024 12:06:57 -0700 Subject: [PATCH] format tests --- pylintrc | 1 + tests/conftest.py | 13 +++++++------ tests/test_binary_sensor.py | 1 + tests/test_camera.py | 1 + tests/test_diagnostics.py | 1 + tests/test_helpers.py | 4 +++- tests/test_sensor.py | 1 + 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pylintrc b/pylintrc index 9de55498..06d8ef25 100644 --- a/pylintrc +++ b/pylintrc @@ -31,6 +31,7 @@ disable= broad-except, too-many-lines, too-many-locals, + abstract-method, [REFACTORING] diff --git a/tests/conftest.py b/tests/conftest.py index 0323ad4b..2ac543c4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """Fixtures for Mail and Packages tests.""" + import asyncio import aiohttp import datetime @@ -18,6 +19,12 @@ pytestmark = pytest.mark.asyncio +@pytest.fixture(autouse=True) +def auto_enable_custom_integrations(enable_custom_integrations): + """Enable custom integration tests.""" + yield + + @pytest.fixture() def mock_update(): """Mock email data update class values.""" @@ -1488,9 +1495,3 @@ def mock_update_amazon_image(): # value = mock.Mock() mock_update.return_value = FAKE_UPDATE_DATA_BIN yield mock_update - - -@pytest.fixture(autouse=True) -def auto_enable_custom_integrations(enable_custom_integrations): - """Enable custom integration tests.""" - yield diff --git a/tests/test_binary_sensor.py b/tests/test_binary_sensor.py index 3d8bce05..51672ff2 100644 --- a/tests/test_binary_sensor.py +++ b/tests/test_binary_sensor.py @@ -1,4 +1,5 @@ """Test Mail and Packages binary sensors.""" + import pytest from pytest_homeassistant_custom_component.common import MockConfigEntry from sqlalchemy import true diff --git a/tests/test_camera.py b/tests/test_camera.py index 1a99866e..1d9d1d43 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -1,4 +1,5 @@ """Tests for camera component.""" + import logging import pytest from unittest.mock import mock_open, patch diff --git a/tests/test_diagnostics.py b/tests/test_diagnostics.py index b27c5061..43bc8269 100644 --- a/tests/test_diagnostics.py +++ b/tests/test_diagnostics.py @@ -1,4 +1,5 @@ """Test the Mail and Packages diagnostics.""" + from unittest.mock import patch import pytest diff --git a/tests/test_helpers.py b/tests/test_helpers.py index f4128e03..82d67c97 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,4 +1,5 @@ """Tests for helpers module.""" + import datetime import errno from freezegun import freeze_time @@ -763,7 +764,8 @@ async def test_dhl_no_utf8(hass, mock_imap_dhl_no_utf8, caplog): result = get_count(mock_imap_dhl_no_utf8, "dhl_delivering", True, "./", hass) assert result["count"] == 1 assert result["tracking"] == ["4212345678"] - #assert "UTF-8 not supported: ('BAD', ['Unsupported'])" in caplog.text + # assert "UTF-8 not supported: ('BAD', ['Unsupported'])" in caplog.text + # TODO: Get updated hermes email # @pytest.mark.asyncio diff --git a/tests/test_sensor.py b/tests/test_sensor.py index 22322904..dcc8e277 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -1,4 +1,5 @@ """ Test Mail and Packages sensors.""" + import pytest from pytest_homeassistant_custom_component.common import MockConfigEntry