Clean Code: Python

Fix issues found by flake8-bugbear:

* Unused loop variables
* assert statements in non-test code
* mixing test code with production code
* mark one excessive test which takes ~10min to run
  as 'slow'
This commit is contained in:
Martin Thoma
2022-03-18 14:58:25 +01:00
parent f7deaba4a1
commit f52d9a0e54
27 changed files with 97 additions and 57 deletions

View File

@@ -55,7 +55,7 @@ def main():
pattern_height = len(pattern)
pattern_width = 0
for line_num, line in pattern.items():
for _line_num, line in pattern.items():
pattern_width = max(pattern_width, len(line))
min_x = 11 - pattern_height // 2
@@ -94,7 +94,7 @@ def main():
p = 0
g += 1
for x in range(0, min_x):
for _ in range(min_x):
print()
for x in range(min_x, max_x + 1):
@@ -120,7 +120,7 @@ def main():
print("".join(line))
# line 295
for x in range(max_x + 1, MAX_HEIGHT):
for _ in range(max_x + 1, MAX_HEIGHT):
print()
print()