Skip to content

Fix #889: Add DeepSource config and fix some major issues #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version = 1

test_patterns = [
'git/test/**/test_*.py'
]

exclude_patterns = [
'doc/**',
'etc/sublime-text'
]

[[analyzers]]
name = 'python'
enabled = true
runtime_version = '2.x.x'
5 changes: 2 additions & 3 deletions git/objects/submodule/base.py
Original file line number Diff line number Diff line change
@@ -864,9 +864,8 @@ def remove(self, module=True, force=False, configuration=True, dry_run=False):
rmtree(wtd)
except Exception as ex:
if HIDE_WINDOWS_KNOWN_ERRORS:
raise SkipTest("FIXME: fails with: PermissionError\n %s", ex)
else:
raise
raise SkipTest("FIXME: fails with: PermissionError\n {}".format(ex))
raise
# END delete tree if possible
# END handle force

2 changes: 1 addition & 1 deletion git/test/test_config.py
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ def setUp(self):
def tearDown(self):
for lfp in glob.glob(_tc_lock_fpaths):
if osp.isfile(lfp):
raise AssertionError('Previous TC left hanging git-lock file: %s', lfp)
raise AssertionError('Previous TC left hanging git-lock file: {}'.format(lfp))

def _to_memcache(self, file_path):
with open(file_path, "rb") as fp:
13 changes: 8 additions & 5 deletions git/test/test_git.py
Original file line number Diff line number Diff line change
@@ -134,15 +134,18 @@ def test_it_accepts_environment_variables(self):

def test_persistent_cat_file_command(self):
# read header only
import subprocess as sp
hexsha = "b2339455342180c7cc1e9bba3e9f181f7baa5167"
g = self.git.cat_file(batch_check=True, istream=sp.PIPE, as_process=True)
g = self.git.cat_file(
batch_check=True, istream=subprocess.PIPE, as_process=True
)
g.stdin.write(b"b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
obj_info = g.stdout.readline()

# read header + data
g = self.git.cat_file(batch=True, istream=sp.PIPE, as_process=True)
g = self.git.cat_file(
batch=True, istream=subprocess.PIPE, as_process=True
)
g.stdin.write(b"b2339455342180c7cc1e9bba3e9f181f7baa5167\n")
g.stdin.flush()
obj_info_two = g.stdout.readline()
@@ -160,7 +163,7 @@ def test_persistent_cat_file_command(self):

# same can be achieved using the respective command functions
hexsha, typename, size = self.git.get_object_header(hexsha)
hexsha, typename_two, size_two, data = self.git.get_object_data(hexsha) # @UnusedVariable
hexsha, typename_two, size_two, _ = self.git.get_object_data(hexsha)
self.assertEqual(typename, typename_two)
self.assertEqual(size, size_two)

@@ -264,7 +267,7 @@ def test_environment(self, rw_dir):
remote.fetch()
except GitCommandError as err:
if sys.version_info[0] < 3 and is_darwin:
self.assertIn('ssh-orig, ' in str(err))
self.assertIn('ssh-orig', str(err))
self.assertEqual(err.status, 128)
else:
self.assertIn('FOO', str(err))
2 changes: 1 addition & 1 deletion git/test/test_repo.py
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ def setUp(self):
def tearDown(self):
for lfp in glob.glob(_tc_lock_fpaths):
if osp.isfile(lfp):
raise AssertionError('Previous TC left hanging git-lock file: %s', lfp)
raise AssertionError('Previous TC left hanging git-lock file: {}'.format(lfp))
import gc
gc.collect()

5 changes: 2 additions & 3 deletions git/util.py
Original file line number Diff line number Diff line change
@@ -98,9 +98,8 @@ def onerror(func, path, exc_info):
func(path) # Will scream if still not possible to delete.
except Exception as ex:
if HIDE_WINDOWS_KNOWN_ERRORS:
raise SkipTest("FIXME: fails with: PermissionError\n %s", ex)
else:
raise
raise SkipTest("FIXME: fails with: PermissionError\n {}".format(ex))
raise

return shutil.rmtree(path, False, onerror)