Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1b9d3b9

Browse files
committed
Removed 'from X import *' whereever possible
1 parentc80d727 commit1b9d3b9

24 files changed

+209
-67
lines changed

‎git/test/lib/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

77
importinspect
8-
frommockimport*
9-
fromassertsimport*
10-
fromhelperimport*
8+
from .assertsimport*
9+
from .helperimport*
1110

1211
__all__= [nameforname,objinlocals().items()
1312
ifnot (name.startswith('_')orinspect.ismodule(obj))]

‎git/test/lib/asserts.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,27 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

77
importre
8-
fromnoseimporttools
9-
fromnose.toolsimport*
108
importstat
119

1210
__all__= ['assert_instance_of','assert_not_instance_of',
1311
'assert_none','assert_not_none',
1412
'assert_match','assert_not_match','assert_mode_644',
15-
'assert_mode_755']+tools.__all__
16-
13+
'assert_mode_755',
14+
'assert_equal','assert_not_equal','assert_raises','patch','raises',
15+
'assert_true','assert_false']
16+
17+
fromnose.toolsimport (
18+
assert_equal,
19+
assert_not_equal,
20+
assert_raises,
21+
raises,
22+
assert_true,
23+
assert_false
24+
)
25+
26+
frommockimport (
27+
patch
28+
)
1729

1830
defassert_instance_of(expected,actual,msg=None):
1931
"""Verify that object is an instance of expected """

‎git/test/performance/lib.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Contains library functions"""
22
importos
3-
fromgit.test.libimport*
3+
fromgit.test.libimport (
4+
TestBase
5+
)
46
fromgitdb.test.libimportskip_on_travis_ci
57
importshutil
68
importtempfile

‎git/test/performance/test_commit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
fromlibimport*
8-
fromgitimport*
7+
from.libimportTestBigRepoRW
8+
fromgitimportCommit
99
fromgitdbimportIStream
1010
fromgit.test.test_commitimportassert_commit_serialization
1111
fromcStringIOimportStringIO

‎git/test/performance/test_odb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fromtimeimporttime
44
importsys
55

6-
fromlibimport (
6+
from.libimport (
77
TestBigRepoR
88
)
99

‎git/test/performance/test_streams.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
"""Performance data streaming performance"""
2-
3-
fromgit.test.libimport*
4-
fromgitdbimport*
5-
fromgitdb.utilimportbin_to_hex
6-
72
fromtimeimporttime
83
importos
94
importsys
105
importsubprocess
116

7+
fromgit.test.libimport (
8+
with_rw_repo
9+
)
10+
fromgitdb.utilimportbin_to_hex
1211
fromgitdb.test.libimportmake_memory_file
1312

14-
fromlibimport (
13+
from.libimport (
1514
TestBigRepoR
1615
)
1716

17+
fromgitdbimport (
18+
LooseObjectDB,
19+
IStream
20+
)
1821

1922
classTestObjDBPerformance(TestBigRepoR):
2023

‎git/test/performance/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
fromtimeimporttime
33
importsys
44

5-
fromlibimport (
5+
from.libimport (
66
TestBigRepoR
77
)
88

@@ -93,14 +93,14 @@ def test_instantiation(self):
9393
# tuple and tuple direct
9494
st=time()
9595
foriinxrange(ni):
96-
t=(1,2,3,4)
96+
(1,2,3,4)
9797
# END for each item
9898
elapsed=time()-st
9999
print>>sys.stderr,"Created %i tuples (1,2,3,4) in %f s ( %f tuples / s)"% (ni,elapsed,ni/elapsed)
100100

101101
st=time()
102102
foriinxrange(ni):
103-
t=tuple((1,2,3,4))
103+
tuple((1,2,3,4))
104104
# END for each item
105105
elapsed=time()-st
106106
print>>sys.stderr,"Created %i tuples tuple((1,2,3,4)) in %f s ( %f tuples / s)"% (ni,elapsed,ni/elapsed)

‎git/test/test_actor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
fromgit.test.libimport*
8-
fromgitimport*
9-
7+
fromgit.test.libimportassert_equal
8+
fromgitimportActor
109

1110
classTestActor(object):
1211

‎git/test/test_base.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77
importgit.objects.baseasbase
88
importos
99

10-
fromgit.test.libimport*
11-
fromgitimport*
10+
fromgit.test.libimport (
11+
TestBase,
12+
assert_raises,
13+
with_rw_repo,
14+
with_rw_and_rw_remote_repo
15+
)
16+
fromgitimport (
17+
Blob,
18+
Tree,
19+
Commit,
20+
TagObject
21+
)
1222
fromgit.objects.utilimportget_object_type_by_name
1323
fromgitdb.utilimporthex_to_bin
1424

‎git/test/test_blob.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
fromgit.test.libimport*
8-
fromgitimport*
7+
fromgit.test.libimport (
8+
TestBase,
9+
assert_equal
10+
)
11+
fromgitimportBlob
912

1013

1114
classTestBlob(TestBase):

‎git/test/test_commit.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@
55
# This module is part of GitPython and is released under
66
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
77

8-
fromgit.test.libimport*
9-
fromgitimport*
8+
fromgit.test.libimport (
9+
TestBase,
10+
assert_equal,
11+
assert_not_equal,
12+
with_rw_repo,
13+
fixture_path,
14+
StringProcessAdapter
15+
)
16+
fromgitimport (
17+
Commit,
18+
Actor,
19+
)
1020
fromgitdbimportIStream
1121
fromgitdb.utilimporthex_to_bin
1222

‎git/test/test_config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
fromgit.test.libimport*
8-
fromgitimport*
7+
fromgit.test.libimport (
8+
TestCase,
9+
fixture_path
10+
)
11+
fromgitimport (
12+
GitConfigParser
13+
)
914
importStringIO
1015
fromcopyimportcopy
1116
fromConfigParserimportNoSectionError

‎git/test/test_db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6-
fromgit.test.libimport*
7-
fromgit.dbimport*
6+
fromgit.test.libimportTestBase
7+
fromgit.dbimportGitCmdObjectDB
88
fromgitdb.utilimportbin_to_hex
99
fromgit.excimportBadObject
1010
importos

‎git/test/test_diff.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
fromgit.test.libimport*
8-
fromgitimport*
9-
7+
fromgit.test.libimport (
8+
TestBase,
9+
StringProcessAdapter,
10+
fixture,
11+
assert_equal,
12+
assert_true,
13+
14+
)
15+
16+
fromgitimport (
17+
Diff,
18+
DiffIndex
19+
)
1020

1121
classTestDiff(TestBase):
1222

‎git/test/test_fun.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
fromgit.test.libimport*
1+
fromgit.test.libimport (
2+
TestBase,
3+
with_rw_repo
4+
)
25
fromgit.objects.funimport (
36
traverse_tree_recursive,
47
traverse_trees_recursive,
@@ -78,7 +81,7 @@ def mktree(self, odb, entries):
7881
@with_rw_repo('0.1.6')
7982
deftest_three_way_merge(self,rwrepo):
8083
defmkfile(name,sha,executable=0):
81-
return (sha,S_IFREG|0644|executable*0111,name)
84+
return (sha,S_IFREG|0o644|executable*0o111,name)
8285

8386
defmkcommit(name,sha):
8487
return (sha,S_IFDIR|S_IFLNK,name)

‎git/test/test_index.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,23 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
fromgit.test.libimport*
8-
fromgitimport*
7+
fromgit.test.libimport (
8+
TestBase,
9+
fixture_path,
10+
fixture,
11+
with_rw_repo
12+
)
13+
fromgitimport (
14+
IndexFile,
15+
BlobFilter,
16+
UnmergedEntriesError,
17+
Tree,
18+
Object,
19+
Diff,
20+
GitCommandError,
21+
CheckoutError,
22+
23+
)
924
fromgitdb.utilimporthex_to_bin
1025
importos
1126
importsys

‎git/test/test_reflog.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
fromgit.test.libimport*
1+
fromgit.test.libimport (
2+
TestBase,
3+
fixture_path
4+
)
25
fromgit.objectsimportIndexObject
3-
fromgit.refsimport*
6+
fromgit.refsimport (
7+
RefLogEntry,
8+
RefLog
9+
)
410
fromgit.utilimportActor
511

612
importtempfile

‎git/test/test_refs.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
frommockimport*
8-
fromgit.test.libimport*
9-
fromgitimport*
7+
fromgit.test.libimport (
8+
TestBase,
9+
with_rw_repo
10+
)
11+
fromgitimport (
12+
Reference,
13+
Head,
14+
TagReference,
15+
RemoteReference,
16+
Commit,
17+
SymbolicReference,
18+
GitCommandError,
19+
RefLog
20+
)
1021
importgit.refsasrefs
1122
fromgit.utilimportActor
1223
fromgit.objects.tagimportTagObject

‎git/test/test_remote.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,24 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
fromgit.test.libimport*
8-
fromgitimport*
7+
fromgit.test.libimport (
8+
TestBase,
9+
with_rw_repo,
10+
with_rw_and_rw_remote_repo
11+
)
12+
fromgitimport (
13+
RemoteProgress,
14+
FetchInfo,
15+
Reference,
16+
SymbolicReference,
17+
Head,
18+
Commit,
19+
PushInfo,
20+
RemoteReference,
21+
TagReference,
22+
Remote,
23+
GitCommandError
24+
)
925
fromgit.utilimportIterableList
1026
importtempfile
1127
importshutil

‎git/test/test_repo.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,30 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6-
fromgit.test.libimport (patch,
7-
TestBase,
8-
with_rw_repo,
9-
fixture,
10-
assert_false,
11-
assert_equal,
12-
assert_true,
13-
raises)
14-
fromgitimport*
6+
fromgit.test.libimport (
7+
patch,
8+
TestBase,
9+
with_rw_repo,
10+
fixture,
11+
assert_false,
12+
assert_equal,
13+
assert_true,
14+
raises
15+
)
16+
fromgitimport (
17+
InvalidGitRepositoryError,
18+
Repo,
19+
NoSuchPathError,
20+
Head,
21+
Commit,
22+
Tree,
23+
IndexFile,
24+
Git,
25+
Reference,
26+
GitDB,
27+
Submodule,
28+
GitCmdObjectDB
29+
)
1530
fromgit.utilimportjoin_path_native
1631
fromgit.excimportBadObject
1732
fromgitdb.utilimportbin_to_hex

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp