diff options
author | Mike Frysinger <vapier@google.com> | 2023-08-21 21:26:51 -0400 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-08-22 18:22:49 +0000 |
commit | 06ddc8c50a7e802dbaf8468144c2b5773cda3714 (patch) | |
tree | 32cda2abbdf1848ad88e87456f753ef1b838fcbe /tests/test_wrapper.py | |
parent | 16109a66b705211efd25f434201d113628aff04c (diff) | |
download | git-repo-06ddc8c50a7e802dbaf8468144c2b5773cda3714.tar.gz |
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 <gavinmak@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'tests/test_wrapper.py')
-rw-r--r-- | tests/test_wrapper.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 @@ | |||
14 | 14 | ||
15 | """Unittests for the wrapper.py module.""" | 15 | """Unittests for the wrapper.py module.""" |
16 | 16 | ||
17 | from io import StringIO | 17 | import io |
18 | import os | 18 | import os |
19 | import re | 19 | import re |
20 | import sys | 20 | import sys |
@@ -47,8 +47,10 @@ class RepoWrapperUnitTest(RepoWrapperTestCase): | |||
47 | def test_version(self): | 47 | def test_version(self): |
48 | """Make sure _Version works.""" | 48 | """Make sure _Version works.""" |
49 | with self.assertRaises(SystemExit) as e: | 49 | with self.assertRaises(SystemExit) as e: |
50 | with mock.patch("sys.stdout", new_callable=StringIO) as stdout: | 50 | with mock.patch("sys.stdout", new_callable=io.StringIO) as stdout: |
51 | with mock.patch("sys.stderr", new_callable=StringIO) as stderr: | 51 | with mock.patch( |
52 | "sys.stderr", new_callable=io.StringIO | ||
53 | ) as stderr: | ||
52 | self.wrapper._Version() | 54 | self.wrapper._Version() |
53 | self.assertEqual(0, e.exception.code) | 55 | self.assertEqual(0, e.exception.code) |
54 | self.assertEqual("", stderr.getvalue()) | 56 | self.assertEqual("", stderr.getvalue()) |