Skip to content

Commit 1b9d3b9

Browse files
committed
Removed 'from X import *' whereever possible
1 parent c80d727 commit 1b9d3b9

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
import inspect
8-
from mock import *
9-
from asserts import *
10-
from helper import *
8+
from .asserts import *
9+
from .helper import *
1110

1211
__all__ = [name for name, obj in locals().items()
1312
if not (name.startswith('_') or inspect.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
import re
8-
from nose import tools
9-
from nose.tools import *
108
import stat
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+
from nose.tools import (
18+
assert_equal,
19+
assert_not_equal,
20+
assert_raises,
21+
raises,
22+
assert_true,
23+
assert_false
24+
)
25+
26+
from mock import (
27+
patch
28+
)
1729

1830
def assert_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
import os
3-
from git.test.lib import *
3+
from git.test.lib import (
4+
TestBase
5+
)
46
from gitdb.test.lib import skip_on_travis_ci
57
import shutil
68
import tempfile

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-
from lib import *
8-
from git import *
7+
from .lib import TestBigRepoRW
8+
from git import Commit
99
from gitdb import IStream
1010
from git.test.test_commit import assert_commit_serialization
1111
from cStringIO import StringIO

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
from time import time
44
import sys
55

6-
from lib import (
6+
from .lib import (
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-
from git.test.lib import *
4-
from gitdb import *
5-
from gitdb.util import bin_to_hex
6-
72
from time import time
83
import os
94
import sys
105
import subprocess
116

7+
from git.test.lib import (
8+
with_rw_repo
9+
)
10+
from gitdb.util import bin_to_hex
1211
from gitdb.test.lib import make_memory_file
1312

14-
from lib import (
13+
from .lib import (
1514
TestBigRepoR
1615
)
1716

17+
from gitdb import (
18+
LooseObjectDB,
19+
IStream
20+
)
1821

1922
class TestObjDBPerformance(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
from time import time
33
import sys
44

5-
from lib import (
5+
from .lib import (
66
TestBigRepoR
77
)
88

@@ -93,14 +93,14 @@ def test_instantiation(self):
9393
# tuple and tuple direct
9494
st = time()
9595
for i in xrange(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
for i in xrange(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-
from git.test.lib import *
8-
from git import *
9-
7+
from git.test.lib import assert_equal
8+
from git import Actor
109

1110
class TestActor(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
import git.objects.base as base
88
import os
99

10-
from git.test.lib import *
11-
from git import *
10+
from git.test.lib import (
11+
TestBase,
12+
assert_raises,
13+
with_rw_repo,
14+
with_rw_and_rw_remote_repo
15+
)
16+
from git import (
17+
Blob,
18+
Tree,
19+
Commit,
20+
TagObject
21+
)
1222
from git.objects.util import get_object_type_by_name
1323
from gitdb.util import hex_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-
from git.test.lib import *
8-
from git import *
7+
from git.test.lib import (
8+
TestBase,
9+
assert_equal
10+
)
11+
from git import Blob
912

1013

1114
class TestBlob(TestBase):

0 commit comments

Comments
 (0)