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

@@ -882,7 +882,7 @@ def new_quadrant():
if b3 > 0:
b4, b5 = find_empty_place() # position of starbase (sector)
insert_marker(b4, b5, ">!<")
for i in range(s3):
for _ in range(s3):
r1, r2 = find_empty_place()
insert_marker(r1, r2, " * ")

View File

@@ -14,7 +14,7 @@ def get_yes_no(prompt):
def print_header():
for i in range(12):
for _ in range(12):
print()
t10 = " " * 10
print(t10 + "*************************************")
@@ -24,7 +24,7 @@ def print_header():
print(t10 + "* *")
print(t10 + "* *")
print(t10 + "*************************************")
for i in range(8):
for _ in range(8):
print()