Enable Ruff PT023, disable PT011, PT012, PT018 (#113900)

* Enable Ruff PT023

* Set mark parantheses to False

* Disable PT011, PT012, PT018
This commit is contained in:
Sid 2024-03-21 09:43:27 +01:00 committed by GitHub
parent 3b66328591
commit 8e1f57f663
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -659,6 +659,9 @@ ignore = [
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"PT004", # Fixture {fixture} does not return anything, add leading underscore
"PT011", # pytest.raises({exception}) is too broad, set the `match` parameter or use a more specific exception
"PT012", # `pytest.raises()` block should contain a single simple statement
"PT018", # Assertion should be broken down into multiple parts
"SIM102", # Use a single if statement instead of nested if statements
"SIM108", # Use ternary operator {contents} instead of if-else-block
"SIM115", # Use context handler for opening files
@ -683,10 +686,6 @@ ignore = [
"PLE0605",
# temporarily disabled
"PT011",
"PT018",
"PT012",
"PT023",
"PT019"
]
@ -704,6 +703,7 @@ voluptuous = "vol"
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"async_timeout".msg = "use asyncio.timeout instead"

View File

@ -100,7 +100,7 @@ async def test_setup_and_stop_waits_for_ha(
# We use xfail with this test because there is an unhandled exception
# in a background task in this test.
# The exception is raised by mqtt.async_publish.
@pytest.mark.xfail()
@pytest.mark.xfail
async def test_startup_no_mqtt(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
) -> None: