Skip to content

Commit

Permalink
Updated debounce test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbkarlsson authored Feb 23, 2023
1 parent e38d47f commit 390e8d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ def skip_service_calls_fixture():
yield


# This fixture is used to prevent calls to update_hourly().
@pytest.fixture(name="skip_update_hourly")
def skip_update_hourly_fixture():
"""Skip update_hourly."""
with patch(
"custom_components.ev_smart_charging.coordinator.EVSmartChargingCoordinator.update_hourly"
):
yield


def pytest_configure(config):
"""Register a new marker"""
config.addinivalue_line("markers", "ensure_debounce")
Expand Down
6 changes: 5 additions & 1 deletion tests/coordinator/test_coordinator_debounce.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
@pytest.mark.ensure_debounce
@freeze_time("2022-09-30T02:00:00+02:00", tick=True)
async def test_coordinator_debounce(
hass: HomeAssistant, skip_service_calls, set_cet_timezone, freezer
hass: HomeAssistant,
skip_service_calls,
set_cet_timezone,
freezer,
skip_update_hourly,
):
"""Test Coordinator debounce."""

Expand Down

0 comments on commit 390e8d4

Please sign in to comment.