mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Fix test coverage, reverting top level import ptvsd (#28118)
This commit is contained in:
parent
4700d647b0
commit
adb15286b4
@ -8,7 +8,6 @@ from asyncio import Event
|
||||
import logging
|
||||
from threading import Thread
|
||||
|
||||
import ptvsd
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
@ -37,6 +36,12 @@ CONFIG_SCHEMA = vol.Schema(
|
||||
|
||||
async def async_setup(hass: HomeAssistantType, config: ConfigType):
|
||||
"""Set up ptvsd debugger."""
|
||||
|
||||
# This is a local import, since importing this at the top, will cause
|
||||
# ptvsd to hook into `sys.settrace`. So does `coverage` to generate
|
||||
# coverage, resulting in a battle and incomplete code test coverage.
|
||||
import ptvsd # pylint: disable=import-outside-toplevel
|
||||
|
||||
conf = config[DOMAIN]
|
||||
host = conf[CONF_HOST]
|
||||
port = conf[CONF_PORT]
|
||||
|
Loading…
x
Reference in New Issue
Block a user