Fix test coverage, reverting top level import ptvsd (#28118)
This commit is contained in:
parent
4700d647b0
commit
adb15286b4
1 changed files with 6 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue