From 799c8536800e75d7ddaef2b588754234db363245 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 15 Nov 2023 19:57:15 -0500 Subject: [PATCH] Improve ordering/grouping of a few imports In modules soon to be modified, so if subsequent commits are later reverted, these import tweaks are not automatically undone. --- test/test_remote.py | 27 ++++++++++++++------------- test/test_repo.py | 25 ++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/test_remote.py b/test/test_remote.py index 12de18476..711c7b1bc 100644 --- a/test/test_remote.py +++ b/test/test_remote.py @@ -3,36 +3,37 @@ # This module is part of GitPython and is released under the # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ +import os.path as osp +from pathlib import Path import random import tempfile -import pytest from unittest import skipIf +import pytest + from git import ( - RemoteProgress, + Commit, FetchInfo, - Reference, - SymbolicReference, + GitCommandError, Head, - Commit, PushInfo, + Reference, + Remote, + RemoteProgress, RemoteReference, + SymbolicReference, TagReference, - Remote, - GitCommandError, ) from git.cmd import Git -from pathlib import Path from git.exc import UnsafeOptionError, UnsafeProtocolError +from git.util import rmtree, HIDE_WINDOWS_FREEZE_ERRORS, IterableList from test.lib import ( + GIT_DAEMON_PORT, TestBase, - with_rw_repo, - with_rw_and_rw_remote_repo, fixture, - GIT_DAEMON_PORT, + with_rw_and_rw_remote_repo, + with_rw_repo, ) -from git.util import rmtree, HIDE_WINDOWS_FREEZE_ERRORS, IterableList -import os.path as osp # Make sure we have repeatable results. diff --git a/test/test_repo.py b/test/test_repo.py index f853e2b36..3cde25184 100644 --- a/test/test_repo.py +++ b/test/test_repo.py @@ -8,6 +8,7 @@ from io import BytesIO import itertools import os +import os.path as osp import pathlib import pickle import sys @@ -17,22 +18,22 @@ import pytest from git import ( + BadName, + Commit, + Git, + GitCmdObjectDB, + GitCommandError, + GitDB, + Head, + IndexFile, InvalidGitRepositoryError, - Repo, NoSuchPathError, - Head, - Commit, Object, - Tree, - IndexFile, - Git, Reference, - GitDB, - Submodule, - GitCmdObjectDB, Remote, - BadName, - GitCommandError, + Repo, + Submodule, + Tree, ) from git.exc import ( BadObject, @@ -43,8 +44,6 @@ from git.util import bin_to_hex, cygpath, join_path_native, rmfile, rmtree from test.lib import TestBase, fixture, with_rw_directory, with_rw_repo -import os.path as osp - def iter_flatten(lol): for items in lol: