From c63320cc31998593583a7c0e3477788fdd456ac8 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 2 Jun 2019 15:41:48 -0700 Subject: [PATCH] codecs.open / io.open --- src/_pytest/pytester.py | 9 ++++----- testing/logging/test_reporting.py | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 572a41f89..c7a8ca693 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1,5 +1,4 @@ """(disabled by default) support for testing pytest and pytest plugins.""" -import codecs import gc import os import platform @@ -1089,8 +1088,8 @@ class Testdir: p2 = self.tmpdir.join("stderr") print("running:", *cmdargs) print(" in:", py.path.local()) - f1 = codecs.open(str(p1), "w", encoding="utf8") - f2 = codecs.open(str(p2), "w", encoding="utf8") + f1 = open(str(p1), "w", encoding="utf8") + f2 = open(str(p2), "w", encoding="utf8") try: now = time.time() popen = self.popen( @@ -1125,8 +1124,8 @@ class Testdir: finally: f1.close() f2.close() - f1 = codecs.open(str(p1), "r", encoding="utf8") - f2 = codecs.open(str(p2), "r", encoding="utf8") + f1 = open(str(p1), "r", encoding="utf8") + f2 = open(str(p2), "r", encoding="utf8") try: out = f1.read().splitlines() err = f2.read().splitlines() diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index fc775b951..690a0c5b8 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -1,6 +1,5 @@ import os import re -from io import open import six