From e0e88ceaaae4b27913cc9d3b48bf79c681605fba Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 2 Nov 2019 08:00:10 -0700 Subject: Refs #30116 -- Simplified stdout/stderr decoding with subprocess.run()'s encoding argument. The encoding argument has been available since Python 3.6. https://docs.python.org/3/library/subprocess.html#subprocess.run --- tests/postgres_tests/test_integration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/postgres_tests') diff --git a/tests/postgres_tests/test_integration.py b/tests/postgres_tests/test_integration.py index da3ccb028d..db082a6495 100644 --- a/tests/postgres_tests/test_integration.py +++ b/tests/postgres_tests/test_integration.py @@ -16,7 +16,7 @@ class PostgresIntegrationTests(PostgreSQLSimpleTestCase): stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, cwd=os.path.dirname(__file__), - env=test_environ + env=test_environ, + encoding='utf-8', ) - stderr = '\n'.join([e.decode() for e in result.stderr.splitlines()]) - self.assertEqual(result.returncode, 0, msg=stderr) + self.assertEqual(result.returncode, 0, msg=result.stderr) -- cgit v1.3