style: use import types everywhere

Align with Google style guides and `import types` as a module
rather than import symbols out of it.

Change-Id: I20f8058eb1b5dafc1d2964c276e28b95b188bfff
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/654803
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Brian Gan <brgan@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-11-06 10:29:39 -08:00
1 parent 8f2c0f1483
commit a4b44c5026
3 files changed
+4 -6

No files matched your search

-2
View File
@@ -55,10 +55,8 @@ per-file-ignores =
tests/test_error.py: IMR241,
tests/test_hooks.py: IMR241,
tests/test_main.py: IMR241,
tests/test_release_update_manpages.py: IMR241,
tests/test_repo_logging.py: IMR241,
tests/test_subcmds.py: IMR241,
tests/test_subcmds_rebase.py: IMR241,
tests/test_subcmds_sync.py: IMR241,
extend-ignore =
# E203: Whitespace before ':'
+2 -2
View File
@@ -16,7 +16,7 @@
import runpy
import sys
from types import ModuleType
import types
import pytest
import utils_for_test
@@ -31,7 +31,7 @@ def test_wrapper_does_not_run_main_for_multiprocessing_child(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""Do not rerun main when multiprocessing re-executes the wrapper."""
fake_update_manpages = ModuleType("update_manpages")
fake_update_manpages = types.ModuleType("update_manpages")
# Mock this because the real module requires newer Python versions than
# our unittest framework does.
+2 -2
View File
@@ -16,7 +16,7 @@
import contextlib
import io
from types import SimpleNamespace
import types
from unittest import mock
import error
@@ -66,7 +66,7 @@ def test_execute_delegates_autostash_to_rebase() -> None:
branch.LocalMerge = "refs/remotes/origin/main"
project.GetBranch.return_value = branch
cmd.GetProjects = mock.MagicMock(return_value=[project])
opt = SimpleNamespace(
opt = types.SimpleNamespace(
interactive=False,
fail_fast=False,
whitespace=None,