Skip to content

Commit

Permalink
STY: Apply ruff/flake8-comprehensions rule C406
Browse files Browse the repository at this point in the history
C406 Unnecessary `list` literal (rewrite as a `dict` literal)
  • Loading branch information
DimitriPapadopoulos committed Sep 22, 2024
1 parent 83eaf0b commit c544b89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nibabel/cifti2/tests/test_cifti2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_cifti2_metadata():
assert len(md) == 1
assert list(iter(md)) == ['a']
assert md['a'] == 'aval'
assert md.data == dict([('a', 'aval')])
assert md.data == {'a': 'aval'}

with pytest.warns(FutureWarning):
md = ci.Cifti2MetaData(metadata={'a': 'aval'})
Expand All @@ -57,7 +57,7 @@ def test_cifti2_metadata():
md['a'] = 'aval'
assert md['a'] == 'aval'
assert len(md) == 1
assert md.data == dict([('a', 'aval')])
assert md.data == {'a': 'aval'}

del md['a']
assert len(md) == 0
Expand Down

0 comments on commit c544b89

Please sign in to comment.