ref: Add ALL ruff rules for tests (#4183)

Add ALL ruff rules for tests
This commit is contained in:
Christophe Bornet 2024-10-19 22:41:37 +02:00 committed by GitHub
commit f96f2eaf8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
67 changed files with 421 additions and 361 deletions

View file

@ -7,7 +7,7 @@ class TestComponent(CustomComponent):
def refresh_values(self):
# This is a function that will be called every time the component is updated
# and should return a list of random strings
return [f"Random {random.randint(1, 100)}" for _ in range(5)]
return [f"Random {random.randint(1, 100)}" for _ in range(5)] # noqa: S311
def build_config(self):
return {"param": {"display_name": "Param", "options": self.refresh_values}}

View file

@ -16,7 +16,7 @@ class MultipleOutputsComponent(Component):
]
def certain_output(self) -> int:
return randint(0, self.number)
return randint(0, self.number) # noqa: S311
def other_output(self) -> int:
return self.certain_output()

View file

@ -8,7 +8,7 @@ class TestComponent(CustomComponent):
def refresh_values(self):
# This is a function that will be called every time the component is updated
# and should return a list of random strings
return [f"Random {random.randint(1, 100)}" for _ in range(5)]
return [f"Random {random.randint(1, 100)}" for _ in range(5)] # noqa: S311
def build_config(self):
return {"param": Input(display_name="Param", options=self.refresh_values)}