Skip to content

Commit a7db47f

Browse files
committed
Fix style fails for newer ruff.
1 parent ecdde24 commit a7db47f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/iris/tests/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,9 @@ def assertCML(self, cubes, reference_filename=None, checksum=True):
447447
def assertTextFile(self, source_filename, reference_filename, desc="text file"):
448448
"""Check if two text files are the same, printing any diffs."""
449449
with open(source_filename) as source_file:
450-
source_text = source_file.readlines()
450+
source_text = list(source_file) # a list of line strings
451451
with open(reference_filename) as reference_file:
452-
reference_text = reference_file.readlines()
452+
reference_text = list(reference_file) # a list of line strings
453453
if reference_text != source_text:
454454
diff = "".join(
455455
difflib.unified_diff(
@@ -548,9 +548,7 @@ def assertRepr(self, obj, reference_filename):
548548
def _check_same(self, item, reference_path, type_comparison_name="CML"):
549549
if self._check_reference_file(reference_path):
550550
with open(reference_path, "rb") as reference_fh:
551-
reference = "".join(
552-
part.decode("utf-8") for part in reference_fh.readlines()
553-
)
551+
reference = "".join(part.decode("utf-8") for part in reference_fh)
554552
self._assert_str_same(reference, item, reference_path, type_comparison_name)
555553
else:
556554
self._ensure_folder(reference_path)

lib/iris/tests/integration/test_netcdf__loadsaveattrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ def test_16_localstyle(self, local_attr, origin_style, do_split):
10221022
expected_result = [expect_global, expect_var]
10231023
if do_split and origin_style == "input_global":
10241024
# The result is simply the "other way around"
1025-
expected_result = expected_result[::-1]
1025+
expected_result.reverse()
10261026
self.check_roundtrip_results(expected_result)
10271027

10281028
@pytest.mark.parametrize("testcase", _MATRIX_TESTCASES[:max_param_attrs])

0 commit comments

Comments
 (0)