Prevent imports from tests in core codebase (#133928)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>pull/133936/head
parent
2d5e2aa4b4
commit
771ead9d7b
|
@ -904,6 +904,7 @@ mark-parentheses = false
|
|||
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
||||
"async_timeout".msg = "use asyncio.timeout instead"
|
||||
"pytz".msg = "use zoneinfo instead"
|
||||
"tests".msg = "You should not import tests"
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
force-sort-within-sections = true
|
||||
|
|
|
@ -5,3 +5,7 @@ extend = "../pyproject.toml"
|
|||
forced-separate = [
|
||||
"tests",
|
||||
]
|
||||
|
||||
[lint.flake8-tidy-imports.banned-api]
|
||||
"async_timeout".msg = "use asyncio.timeout instead"
|
||||
"pytz".msg = "use zoneinfo instead"
|
||||
|
|
|
@ -10,6 +10,10 @@ extend-ignore = [
|
|||
"SLF001", # Private member accessed: Tests do often test internals a lot
|
||||
]
|
||||
|
||||
[lint.flake8-tidy-imports.banned-api]
|
||||
"async_timeout".msg = "use asyncio.timeout instead"
|
||||
"pytz".msg = "use zoneinfo instead"
|
||||
|
||||
[lint.isort]
|
||||
known-first-party = [
|
||||
"homeassistant",
|
||||
|
|
Loading…
Reference in New Issue