Skip to content

Commit 396b35b

Browse files
committed
Merge branch 'mr/fix_RUF059_rule' into 'master'
Fix RUF059 rule See merge request it/e3-core!226
2 parents 3a863eb + 3116842 commit 396b35b

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

tests/tests_e3/anod/context_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,20 +547,20 @@ def anod_action(
547547
for uid, action in ac.tree:
548548
if uid.endswith("spec12.build"):
549549
assert ac.tree.get_tag(uid)
550-
cdist, cuid, ctag = reverse_dag.get_context(uid)[0]
550+
_, cuid, ctag = reverse_dag.get_context(uid)[0]
551551
assert cuid == uid
552552
assert ctag["plan_args"]["weathers"] == "foo"
553553
assert ctag["plan_line"] == "plan.txt:2"
554554
elif uid.endswith("spec3.build"):
555555
assert not ac.tree.get_tag(uid)
556-
cdist, cuid, ctag = reverse_dag.get_context(uid)[0]
556+
_, cuid, ctag = reverse_dag.get_context(uid)[0]
557557
assert cuid != uid
558558
assert cuid.endswith("spec10.build")
559559
assert ctag["plan_args"]["weathers"] == "foo"
560560
assert ctag["plan_line"] == "plan.txt:3"
561561
elif uid.endswith("spec11.build"):
562562
assert ac.tree.get_tag(uid), ac.tree.tags
563-
cdist, cuid, ctag = reverse_dag.get_context(uid)[0]
563+
_cdist, cuid, ctag = reverse_dag.get_context(uid)[0]
564564
assert cuid == uid
565565
assert ctag["plan_args"]["weathers"] == "bar"
566566
assert ctag["plan_line"] == "plan.txt:4"
@@ -667,7 +667,7 @@ def anod_action(
667667
for uid, _ in ac.tree:
668668
if uid.endswith("spec12.build"):
669669
assert ac.tree.get_tag(uid)
670-
cdist, cuid, ctag = reverse_dag.get_context(uid)[0]
670+
_cdist, cuid, ctag = reverse_dag.get_context(uid)[0]
671671
assert cuid == uid
672672
assert ctag["plan_args"]["weathers"] == "foo"
673673
assert ctag["plan_line"] == "plan.txt:2"

tests/tests_e3/anod/store/component_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def test_component_download(store) -> None:
487487

488488
def test_component_meta_file() -> None:
489489
"""Check component meta file APIs."""
490-
c, att_1, att_2 = create_component_with_attachments()
490+
c, _att_1, _att_2 = create_component_with_attachments()
491491
cwd: Path = Path.cwd()
492492

493493
with pytest.raises(StoreError, match="non existing metafile"):

tests/tests_e3/slsa/provenance_test.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def create_valid_run_details() -> tuple:
148148

149149
def test_build_definition_as_dict() -> None:
150150
"""Test dict representation of build definition."""
151-
build_type, rd, resolved_dependencies, bd = create_valid_build_definition()
151+
build_type, rd, _resolved_dependencies, bd = create_valid_build_definition()
152152
# Check class attributes.
153153
dict_repr = bd.as_dict()
154154
assert dict_repr.get(Predicate.BuildDefinition.ATTR_BUILD_TYPE) == build_type
@@ -176,7 +176,7 @@ def test_build_definition_as_json() -> None:
176176
def test_build_definition_init() -> None:
177177
"""Test initialization of build definition."""
178178
# Check class attributes.
179-
build_type, rd, resolved_dependencies, bd = create_valid_build_definition()
179+
build_type, rd, _resolved_dependencies, bd = create_valid_build_definition()
180180
assert bd.build_type == build_type
181181
assert bd.external_parameters == EXTERNAL_PARAMETERS
182182
assert bd.internal_parameters == INTERNAL_PARAMETERS
@@ -215,13 +215,13 @@ def test_build_definition_load_json() -> None:
215215

216216
def test_builder_as_dict() -> None:
217217
(
218-
uri,
219-
digest,
220-
rc_annotations,
221-
name,
222-
dl_loc,
223-
media_type,
224-
content,
218+
_uri,
219+
_digest,
220+
_rc_annotations,
221+
_name,
222+
_dl_loc,
223+
_media_type,
224+
_content,
225225
desc,
226226
) = create_valid_resource_descriptor()
227227
build_id: TypeURI = TypeURI(VALID_URIS[1])
@@ -319,7 +319,7 @@ def test_buildmetadata_as_dict() -> None:
319319

320320
def test_buildmetadata_as_json() -> None:
321321
"""Test the JSON representation of a BuildMetadata."""
322-
start_time, invocation_id, finish_time, bm = create_valid_build_metadata()
322+
_start_time, _invocation_id, _finish_time, bm = create_valid_build_metadata()
323323
json_repr: str = bm.as_json()
324324
# Check that the JSON string is valid.
325325
assert json.loads(json_repr)
@@ -462,13 +462,13 @@ def test_predicate_load_json() -> None:
462462

463463
def test_resource_descriptor_add_digest() -> None:
464464
(
465-
uri,
465+
_uri,
466466
digest,
467-
rc_annotations,
468-
name,
469-
dl_loc,
470-
media_type,
471-
content,
467+
_rc_annotations,
468+
_name,
469+
_dl_loc,
470+
_media_type,
471+
_content,
472472
desc,
473473
) = create_valid_resource_descriptor()
474474
assert desc.digest == digest

0 commit comments

Comments
 (0)