Skip to content

Commit 3c44c8b

Browse files
committed
Separate asserts for ruff PT018.
1 parent 0bb70e1 commit 3c44c8b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/iris/tests/unit/fileformats/netcdf/test_bytecoding_datasets.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ def fetch_undecoded_var(path, varname):
6969

7070
def check_array_matching(arr1, arr2):
7171
"""Check for arrays matching shape, dtype and content."""
72-
assert (
73-
arr1.shape == arr2.shape and arr1.dtype == arr2.dtype and np.all(arr1 == arr2)
74-
)
72+
assert arr1.shape == arr2.shape
73+
assert arr1.dtype == arr2.dtype
74+
assert np.all(arr1 == arr2)
7575

7676

7777
def check_raw_content(path, varname, expected_byte_array):
@@ -338,7 +338,8 @@ def test_encodings(self, encoding, tempdir, readmode):
338338
if encoding == "utf-8":
339339
# In this case, with the given non-ascii sample data, the
340340
# "default minimum string length" is overestimated.
341-
assert strlen == 7 and result.dtype == "U7"
341+
assert strlen == 7
342+
assert result.dtype == "U7"
342343
# correct the result dtype to pass the write_strings comparison below
343344
truncated_result = result.astype("U4")
344345
# Also check that content is the same (i.e. not actually truncated)

0 commit comments

Comments
 (0)