fix: linting

This commit is contained in:
SwiftyOS
2024-05-09 10:24:04 +02:00
parent 557894e6c1
commit d07dd42776
7 changed files with 31 additions and 23 deletions

View File

@@ -18,7 +18,9 @@ class TestPasswordGenerator(unittest.TestCase):
def test_password_content(self):
password = password_generator.generate_password()
self.assertTrue(any(c.isdigit() for c in password))
self.assertTrue(any(c in password_generator.string.punctuation for c in password))
self.assertTrue(
any(c in password_generator.string.punctuation for c in password)
)
if __name__ == "__main__":

View File

@@ -1,17 +1,17 @@
from sample_code import multiply_int
# from sample_code import multiply_int
def test_multiply_int(num: int, multiplier, expected_result: int) -> None:
result = multiply_int(num, multiplier)
print(result)
assert (
result == expected_result
), f"AssertionError: Expected the output to be {expected_result}"
# def test_multiply_int(num: int, multiplier, expected_result: int) -> None:
# result = multiply_int(num, multiplier)
# print(result)
# assert (
# result == expected_result
# ), f"AssertionError: Expected the output to be {expected_result}"
if __name__ == "__main__":
# create a trivial test that has 4 as the num, and 2 as the multiplier. Make sure to fill in the expected result
num =
multiplier =
expected_result =
test_multiply_int()
# if __name__ == "__main__":
# # create a trivial test that has 4 as the num, and 2 as the multiplier. Make sure to fill in the expected result
# num =
# multiplier =
# expected_result =
# test_multiply_int()

View File

@@ -1,7 +1,5 @@
from typing import List
from import
def test_two_sum(nums: List, target: int, expected_result: List[int]) -> None:
result = two_sum(nums, target)

View File

@@ -21,7 +21,6 @@ def generate_password(length: int = 8) -> str:
if __name__ == "__main__":
password_length = (
int(sys.argv[sys.argv.index("--length") + 1])
if "--length" in sys.argv else 8
int(sys.argv[sys.argv.index("--length") + 1]) if "--length" in sys.argv else 8
)
print(generate_password(password_length))

View File

@@ -18,7 +18,9 @@ class TestPasswordGenerator(unittest.TestCase):
def test_password_content(self):
password = password_generator.generate_password()
self.assertTrue(any(c.isdigit() for c in password))
self.assertTrue(any(c in password_generator.string.punctuation for c in password))
self.assertTrue(
any(c in password_generator.string.punctuation for c in password)
)
if __name__ == "__main__":

View File

@@ -1,7 +1,13 @@
from typing import Dict
from abstract_class import (AbstractBattleship, Game, GameStatus,
ShipPlacement, Turn, TurnResponse)
from abstract_class import (
AbstractBattleship,
Game,
GameStatus,
ShipPlacement,
Turn,
TurnResponse,
)
class Battleship(AbstractBattleship):

View File

@@ -258,7 +258,8 @@ class WebArenaChallengeSpec(BaseModel):
f"{' and '.join(s.base_url for s in sites)}.\n\n"
+ "\n".join(
s.additional_info.format(url=s.base_url)
for s in sites if s.additional_info
for s in sites
if s.additional_info
)
).strip()
@@ -462,7 +463,7 @@ class WebArenaChallenge(BaseChallenge):
def load_webarena_challenges(
skip_unavailable: bool = True
skip_unavailable: bool = True,
) -> Iterator[type[WebArenaChallenge]]:
logger.info("Loading WebArena challenges...")