mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 13:27:47 +01:00
Enable ERA001: fix/rephrase commented-out code
This commit is contained in:
parent
dc34c0f9f3
commit
8a411fd872
@ -18,7 +18,7 @@ def test_backoff_sleep_increments_and_caps(monkeypatch):
|
|||||||
b = backoff_sleep(b, base=0.1, cap=0.3)
|
b = backoff_sleep(b, base=0.1, cap=0.3)
|
||||||
assert b >= 1
|
assert b >= 1
|
||||||
assert len(slept) == 3
|
assert len(slept) == 3
|
||||||
# 0.1, 0.2, 0.3 (capped)
|
# Expected sleep values: first=0.1, second=0.2, third=0.3 (capped)
|
||||||
assert slept[0] == 0.1
|
assert slept[0] == 0.1
|
||||||
assert slept[1] == 0.2
|
assert slept[1] == 0.2
|
||||||
assert slept[2] == 0.3
|
assert slept[2] == 0.3
|
||||||
|
|||||||
@ -178,7 +178,7 @@ def _detect_total_mem_mb() -> int | None:
|
|||||||
return int(psutil.virtual_memory().total // (1024 * 1024))
|
return int(psutil.virtual_memory().total // (1024 * 1024))
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
# Fallback: Linux /proc/meminfo
|
# Fallback approach for Linux systems using proc meminfo.
|
||||||
try:
|
try:
|
||||||
with open("/proc/meminfo", encoding="utf-8", errors="ignore") as f:
|
with open("/proc/meminfo", encoding="utf-8", errors="ignore") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
@ -319,7 +319,7 @@ def main():
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Hash (MB)
|
# Configure hash table size in MB.
|
||||||
if "Hash" in options:
|
if "Hash" in options:
|
||||||
try:
|
try:
|
||||||
if args.hash_mb is not None:
|
if args.hash_mb is not None:
|
||||||
|
|||||||
@ -75,6 +75,4 @@ for filename in os.listdir(
|
|||||||
currentPath + "/" + filename,
|
currentPath + "/" + filename,
|
||||||
currentPath + "/" + secondFolderName + "/" + filename,
|
currentPath + "/" + secondFolderName + "/" + filename,
|
||||||
)
|
)
|
||||||
# else:
|
|
||||||
# print(key)
|
|
||||||
cv2.destroyAllWindows()
|
cv2.destroyAllWindows()
|
||||||
|
|||||||
@ -68,7 +68,6 @@ ignore = [
|
|||||||
"S310", # suspicious-url-open - acceptable for scripts
|
"S310", # suspicious-url-open - acceptable for scripts
|
||||||
"S110", # try-except-pass - common pattern in scripts
|
"S110", # try-except-pass - common pattern in scripts
|
||||||
"S112", # try-except-continue - acceptable pattern
|
"S112", # try-except-continue - acceptable pattern
|
||||||
"ERA001", # commented-out-code - keeping for reference
|
|
||||||
"B023", # function-uses-loop-variable - common pattern with closures
|
"B023", # function-uses-loop-variable - common pattern with closures
|
||||||
"DTZ005", # datetime.now without tz - acceptable for local scripts
|
"DTZ005", # datetime.now without tz - acceptable for local scripts
|
||||||
"E741", # ambiguous-variable-name - sometimes intentional (e.g. l for list)
|
"E741", # ambiguous-variable-name - sometimes intentional (e.g. l for list)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user