From 3d5cd69e78ab65c494f587ce95abbd0c6d45f801 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Sat, 13 Jul 2024 12:11:19 +0200 Subject: [PATCH] Fix the problem with impure tests changing backend_fixtures One of the tests is impure, changing backend_fixtures, which breaks test_model. This commit makes backend_fixtures to return a deep copy of backend_fixtures_json isntead of returning them directly. --- python/tests/fixtures/backend_fixtures.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/tests/fixtures/backend_fixtures.py b/python/tests/fixtures/backend_fixtures.py index 6fec74e3f..dd455b699 100644 --- a/python/tests/fixtures/backend_fixtures.py +++ b/python/tests/fixtures/backend_fixtures.py @@ -14,6 +14,7 @@ # limitations under the License. # +import copy import json import os @@ -80,4 +81,4 @@ @pytest.fixture def backend_fixtures(): - return backend_fixtures_json + return copy.deepcopy(backend_fixtures_json)