From 06ddc8c50a7e802dbaf8468144c2b5773cda3714 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 21 Aug 2023 21:26:51 -0400 Subject: tweak stdlib imports to follow Google style guide Google Python style guide says to import modules. Clean up all our stdlib imports. Leave the repo ones alone for now as that's a much bigger shave. Change-Id: Ida42fc2ae78b86e6b7a6cbc98f94ca04b295f8cc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383714 Reviewed-by: Gavin Mak Commit-Queue: Mike Frysinger Tested-by: Mike Frysinger --- tests/test_wrapper.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/test_wrapper.py') diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index 4e8263b2..ef4dce10 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py @@ -14,7 +14,7 @@ """Unittests for the wrapper.py module.""" -from io import StringIO +import io import os import re import sys @@ -47,8 +47,10 @@ class RepoWrapperUnitTest(RepoWrapperTestCase): def test_version(self): """Make sure _Version works.""" with self.assertRaises(SystemExit) as e: - with mock.patch("sys.stdout", new_callable=StringIO) as stdout: - with mock.patch("sys.stderr", new_callable=StringIO) as stderr: + with mock.patch("sys.stdout", new_callable=io.StringIO) as stdout: + with mock.patch( + "sys.stderr", new_callable=io.StringIO + ) as stderr: self.wrapper._Version() self.assertEqual(0, e.exception.code) self.assertEqual("", stderr.getvalue()) -- cgit v1.2.3-54-g00ecf