text files on Unix should end with a new line character

This commit is contained in:
Martin Diehl 2021-11-30 11:04:41 +01:00
parent 84353ae545
commit 3a51e1119b
14 changed files with 17 additions and 15 deletions

View File

@ -303,7 +303,9 @@ class Colormap(mpl.colors.ListedColormap):
'RGBPoints':colors
}]
json.dump(out,self._get_file_handle(fname,'json'),indent=4)
fhandle = self._get_file_handle(fname,'json')
json.dump(out,fhandle,indent=4)
fhandle.write('\n')
def save_ASCII(self,fname=None):

View File

@ -388,9 +388,9 @@ class TestResult:
cur = hashlib.md5(f.read().encode()).hexdigest()
if update:
with open((ref_path/'export_VTK'/request.node.name).with_suffix('.md5'),'w') as f:
f.write(cur)
f.write(cur+'\n')
with open((ref_path/'export_VTK'/request.node.name).with_suffix('.md5')) as f:
assert cur == f.read()
assert cur == f.read()[:-1]
@pytest.mark.parametrize('mode',['point','cell'])
@pytest.mark.parametrize('output',[False,True])