From eb3557be7a4b028495bba292e5e1ac153512603f Mon Sep 17 00:00:00 2001 From: Sander Date: Fri, 19 Apr 2024 14:27:23 +0000 Subject: [PATCH] Optimize fixture --- tests/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9b10cd2..03172b2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -67,11 +67,11 @@ def enable_all_entities(): @pytest.fixture(name="mocked_data") def mocked_data_fixture(request): """Use mocked data in the integration""" - json_file = request.node.get_closest_marker("fixture") - if json_file is None: - json_file = "response.json" - else: - json_file = json_file.args[0] + json_file = "response.json" + fixture = request.node.get_closest_marker("fixture") + + if fixture is not None: + json_file = fixture.args[0] with patch( "custom_components.knmi.KnmiApiClient.get_response_text",