Skip to content

Commit 6cab761

Browse files
committed
style: fix ruff errors
1 parent 5eb512c commit 6cab761

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/_gettsim/policy_environment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def upsert_functions(
186186
result = object.__new__(PolicyEnvironment)
187187
result._functions = new_functions # noqa: SLF001
188188
result._params = self._params # noqa: SLF001
189-
result._aggregate_by_group_specs = (
189+
result._aggregate_by_group_specs = ( # noqa: SLF001
190190
self._aggregate_by_group_specs
191191
)
192192
result._aggregate_by_p_id_specs = self._aggregate_by_p_id_specs # noqa: SLF001
@@ -211,7 +211,7 @@ def replace_all_parameters(self, params: dict[str, Any]):
211211
result = object.__new__(PolicyEnvironment)
212212
result._functions = self._functions # noqa: SLF001
213213
result._params = params # noqa: SLF001
214-
result._aggregate_by_group_specs = (
214+
result._aggregate_by_group_specs = ( # noqa: SLF001
215215
self._aggregate_by_group_specs
216216
)
217217
result._aggregate_by_p_id_specs = self._aggregate_by_p_id_specs # noqa: SLF001

src/_gettsim_tests/test_policy_environment.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class TestPolicyEnvironment:
1919
def test_get_function_by_name_exists(self):
20-
function = PolicyFunction(lambda x: 1, function_name="foo")
20+
function = PolicyFunction(lambda: 1, function_name="foo")
2121
environment = PolicyEnvironment([function])
2222

2323
assert environment.get_function_by_name("foo") == function
@@ -33,19 +33,19 @@ def test_get_function_by_name_does_not_exist(self):
3333
PolicyEnvironment([], {}),
3434
PolicyEnvironment(
3535
[
36-
PolicyFunction(lambda x: 1, function_name="foo"),
36+
PolicyFunction(lambda: 1, function_name="foo"),
3737
]
3838
),
3939
PolicyEnvironment(
4040
[
41-
PolicyFunction(lambda x: 1, function_name="foo"),
42-
PolicyFunction(lambda x: 2, function_name="bar"),
41+
PolicyFunction(lambda: 1, function_name="foo"),
42+
PolicyFunction(lambda: 2, function_name="bar"),
4343
]
4444
),
4545
],
4646
)
4747
def test_upsert_functions(self, environment: PolicyEnvironment):
48-
new_function = PolicyFunction(lambda x: 3, function_name="foo")
48+
new_function = PolicyFunction(lambda: 3, function_name="foo")
4949
new_environment = environment.upsert_functions(new_function)
5050

5151
assert new_environment.get_function_by_name("foo") == new_function

0 commit comments

Comments
 (0)