1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Add bluetooth integration (#74653)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
J. Nick Koston
2022-07-08 18:55:31 -05:00
committed by GitHub
parent c27fbce7d0
commit a697672944
27 changed files with 1179 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
"""Tests for the bluetooth component."""
import threading
import pytest
from tests.common import INSTANCES
@pytest.fixture(autouse=True)
def verify_cleanup():
"""Verify that the test has cleaned up resources correctly."""
threads_before = frozenset(threading.enumerate())
yield
if len(INSTANCES) >= 2:
count = len(INSTANCES)
for inst in INSTANCES:
inst.stop()
pytest.exit(f"Detected non stopped instances ({count}), aborting test run")
threads = frozenset(threading.enumerate()) - threads_before
for thread in threads:
assert isinstance(thread, threading._DummyThread)