Skip to content

Commit 3afc274

Browse files
committed
stricter condition on fail
1 parent 239dd8f commit 3afc274

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_test_bit_reproducibility.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,12 @@ def create_mock_output(self, output="output000", modify=False):
112112
restart = mom_restart_pointer.parent / restart_file
113113
rootgrp = Dataset(restart, "a")
114114
for variable in sorted(rootgrp.variables):
115+
# find the first var with a checksum and add 1 to it
115116
var = rootgrp[variable]
116117
if "checksum" in var.ncattrs():
117-
var.setncattr("checksum", var.checksum.strip() + "0")
118+
# add 1 to the checksum and return as uppercase
119+
var_p1 = format(int(var.checksum, 16)-1, 'X')
120+
var.setncattr("checksum", var_p1)
118121
break
119122
rootgrp.close()
120123
else:

0 commit comments

Comments
 (0)