From 1e9a2118dfeb2fb260e6893a938bdd2bf60605f5 Mon Sep 17 00:00:00 2001 From: vil02 <65706193+vil02@users.noreply.github.com> Date: Sat, 25 Apr 2026 22:32:51 +0200 Subject: [PATCH] refactor: simplify `read_example_source_code` --- tests/source_code_examples.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/source_code_examples.py b/tests/source_code_examples.py index c61c1c3..6d93de8 100644 --- a/tests/source_code_examples.py +++ b/tests/source_code_examples.py @@ -102,8 +102,7 @@ def get_example_source_code_path(in_example_id, in_language_id): def read_example_source_code(in_example_id, in_language_id): """reads given source code into a string""" example_path = get_example_source_code_path(in_example_id, in_language_id) - with open(example_path, "r", encoding="utf-8") as file: - return file.read() + return example_path.read_text(encoding="utf-8") def get_full_examples():