From a4fa0925b7e269c945c60dab44924b54279223c4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 30 Jan 2023 11:03:42 +0100 Subject: [PATCH] Small improvement to Withings tests (#86937) --- tests/components/withings/test_init.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/components/withings/test_init.py b/tests/components/withings/test_init.py index 7f9dc68cf0c..9196d5906f6 100644 --- a/tests/components/withings/test_init.py +++ b/tests/components/withings/test_init.py @@ -34,11 +34,8 @@ def config_schema_validate(withings_config) -> dict: def config_schema_assert_fail(withings_config) -> None: """Assert a schema config will fail.""" - try: + with pytest.raises(vol.MultipleInvalid): config_schema_validate(withings_config) - pytest.fail("This line should not have run.") - except vol.error.MultipleInvalid: - assert True def test_config_schema_basic_config() -> None: