Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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