From b403dbec5165aa7153391e7012b103ac7cc25572 Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Wed, 8 Jun 2022 16:31:45 +0300 Subject: [PATCH] Tests: Use pathlib read_text/write_text with encoding(test_custom_extensions_in_hooks.py) --- tests/test_custom_extensions_in_hooks.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_custom_extensions_in_hooks.py b/tests/test_custom_extensions_in_hooks.py index ef9103021..b08225e44 100644 --- a/tests/test_custom_extensions_in_hooks.py +++ b/tests/test_custom_extensions_in_hooks.py @@ -39,7 +39,5 @@ def test_hook_with_extension(template, output_dir): extra_context={'project_slug': 'foobar', 'name': 'Cookiemonster'}, ) - with Path(project_dir, 'README.rst').open() as f: - readme = f.read().strip() - - assert readme == 'Hello Cookiemonster!' + readme = Path(project_dir, 'README.rst').read_text(encoding="utf8") + assert readme.strip() == 'Hello Cookiemonster!'