Use contextlib.suppress where possible (#48189)
This commit is contained in:
parent
9656f260a4
commit
6932cf9534
86 changed files with 238 additions and 398 deletions
|
@ -1,4 +1,5 @@
|
|||
"""The tests for the Demo component."""
|
||||
from contextlib import suppress
|
||||
import json
|
||||
import os
|
||||
|
||||
|
@ -20,10 +21,8 @@ def mock_history(hass):
|
|||
def demo_cleanup(hass):
|
||||
"""Clean up device tracker demo file."""
|
||||
yield
|
||||
try:
|
||||
with suppress(FileNotFoundError):
|
||||
os.remove(hass.config.path(YAML_DEVICES))
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
||||
async def test_setting_up_demo(hass):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue