From 18922718cc6d7ffcb52706d38e0174463838cb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borna=20=C5=A0o=C5=A1tari=C4=87?= Date: Sun, 17 Nov 2024 19:05:33 +0100 Subject: [PATCH] adapt test_loaders for exit() call --- tests/test_loaders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_loaders.py b/tests/test_loaders.py index d508ee7..b563605 100644 --- a/tests/test_loaders.py +++ b/tests/test_loaders.py @@ -7,7 +7,7 @@ @pytest.mark.parametrize("file_name", ["jsonc.json", "json.json"]) def test_load_jsonc(file_name): # we are mocking sys.exit to check if it has been called - with mock.patch("sys.exit") as mock_exit: + with mock.patch("builtins.exit") as mock_exit: result = load_jsonc(f"data/{file_name}") if file_name == "jsonc.json": assert result == {"key1": "value1", "key2": 42, "key3": True} @@ -23,7 +23,7 @@ def test_load_jsonc(file_name): @pytest.mark.parametrize("file_name", ["jsonc.json", "json.json"]) def test_load_json(file_name): # we are mocking sys.exit to check if it has been called - with mock.patch("sys.exit") as mock_exit: + with mock.patch("builtins.exit") as mock_exit: result = load_json(f"data/{file_name}") if file_name == "jsonc.json": mock_exit.assert_called_once_with(1)