Skip to content

Commit f118c18

Browse files
committed
Clarify the temporary load/save exercising tests (a bit).
1 parent c995a8d commit f118c18

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/iris/tests/integration/netcdf/test_chararrays.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def save_dir(tmp_path_factory):
189189

190190
# TODO: the tests don't test things properly yet, they just exercise the code and print
191191
# things for manual debugging.
192-
tsts = (
192+
test_encodings = (
193193
None,
194194
"ascii",
195195
"utf-8",
@@ -201,8 +201,13 @@ def save_dir(tmp_path_factory):
201201
# tsts = ("utf-8", "ascii", "utf-8")
202202

203203

204-
@pytest.mark.parametrize("encoding", tsts)
204+
@pytest.mark.parametrize("encoding", test_encodings)
205205
def test_load_encodings(encoding, save_dir):
206+
"""Load exercise.
207+
208+
Make a testfile with utf-8 content, variously labelled.
209+
Load with Iris + show result (error or cubes).
210+
"""
206211
# small change
207212
print(f"\n=========\nTesting encoding: {encoding}")
208213
filepath = save_dir / f"tmp_load_{str(encoding)}.nc"
@@ -219,8 +224,13 @@ def test_load_encodings(encoding, save_dir):
219224
show_result(filepath)
220225

221226

222-
@pytest.mark.parametrize("encoding", tsts)
227+
@pytest.mark.parametrize("encoding", test_encodings)
223228
def test_save_encodings(encoding, save_dir):
229+
"""Save exercise.
230+
231+
Make test-cube with non-ascii content, and various '_Encoding' labels.
232+
Save with Iris + show result (error or ncdump).
233+
"""
224234
cube = make_testcube(
225235
dataarray=TEST_STRINGS, coordarray=TEST_COORD_VALS, encoding_str=encoding
226236
)

0 commit comments

Comments
 (0)