fix A001 cases

This commit is contained in:
Matthias Mair 2024-08-20 00:42:54 +02:00
parent 78e9de2179
commit db3db041ac
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
3 changed files with 7 additions and 7 deletions

View File

@ -59,7 +59,7 @@ ignore = [
"B904",
# Remove fast
"A001", "A002", "B018"
"A002", "B018"
]
[tool.ruff.lint.pydocstyle]

View File

@ -1033,12 +1033,12 @@ class TestVersionNumber(TestCase):
# Check that the current .git values work too
hash = str(
git_hash = str(
subprocess.check_output('git rev-parse --short HEAD'.split()), 'utf-8'
).strip()
# On some systems the hash is a different length, so just check the first 6 characters
self.assertEqual(hash[:6], version.inventreeCommitHash()[:6])
self.assertEqual(git_hash[:6], version.inventreeCommitHash()[:6])
d = (
str(subprocess.check_output('git show -s --format=%ci'.split()), 'utf-8')
@ -1438,8 +1438,8 @@ class BarcodeMixinTest(InvenTreeTestCase):
'{"part": 17, "stockitem": 12}': 'c88c11ed0628eb7fef0d59b098b96975',
}
for barcode, hash in hashing_tests.items():
self.assertEqual(InvenTree.helpers.hash_barcode(barcode), hash)
for barcode, expected in hashing_tests.items():
self.assertEqual(InvenTree.helpers.hash_barcode(barcode), expected)
class SanitizerTest(TestCase):

View File

@ -118,8 +118,8 @@ class DataImportSession(models.Model):
"""
mapping = {}
for map in self.column_mappings.all():
mapping[map.field] = map.column
for i in self.column_mappings.all():
mapping[i.field] = i.column
return mapping