From df6c0f52c50f7bad6f43194e825ca5badd390b76 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 19 Jul 2024 10:58:59 -0400 Subject: [PATCH] Fixed encoding warning in test. --- tests/test_flake8.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_flake8.py b/tests/test_flake8.py index 979c33b..f8fdda0 100644 --- a/tests/test_flake8.py +++ b/tests/test_flake8.py @@ -3,6 +3,8 @@ from __future__ import print_function +import pathlib + import py import pytest @@ -223,7 +225,6 @@ def test_junit_classname(testdir): testdir.makepyfile("") result = testdir.runpytest("--flake8", "--junit-xml=TEST.xml") junit = testdir.tmpdir.join("TEST.xml") - with open(str(junit)) as j_file: - j_text = j_file.read() + j_text = pathlib.Path(junit).read_text(encoding='utf-8') result.assert_outcomes(passed=1) assert 'classname=""' not in j_text