Skip to content
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

Fix some code quality issues #273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions .deepsource.toml
@@ -0,0 +1,14 @@
version = 1

test_patterns = [
"test_fuzzywuzzy.py",
"test_fuzzywuzzy_hypothesis.py",
"test_fuzzywuzzy_pytest.py"
]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"
2 changes: 1 addition & 1 deletion fuzzywuzzy/utils.py
Expand Up @@ -48,7 +48,7 @@ def decorator(*args, **kwargs):
return decorator


bad_chars = str("").join([chr(i) for i in range(128, 256)]) # ascii dammit!
bad_chars = str("").join(chr(i) for i in range(128, 256)) # ascii dammit!
if PY3:
translation_table = dict((ord(c), None) for c in bad_chars)
unicode = str
Expand Down
4 changes: 2 additions & 2 deletions test_fuzzywuzzy.py
Expand Up @@ -434,7 +434,7 @@ def testWithCutoff2(self):
# Only find 100-score cases
res = process.extractOne(query, choices, score_cutoff=100)
self.assertTrue(res is not None)
best_match, score = res
best_match, _ = res
self.assertTrue(best_match is choices[0])

def testEmptyStrings(self):
Expand Down Expand Up @@ -488,7 +488,7 @@ def test_dict_like_extract(self):
search = 'aaa'
result = process.extract(search, choices)
self.assertTrue(len(result) > 0)
for value, confidence, key in result:
for value, _, _ in result:
self.assertTrue(value in choices.values())

def test_dedupe(self):
Expand Down