Unittests: Fix warnings

- Replace deprecated assertion-aliases
- Make sure opened files are properly closed after usage
This commit is contained in:
Eduard Braun 2015-12-06 22:13:21 +01:00
parent 320bdda6e9
commit c54c5e5d7e
3 changed files with 263 additions and 247 deletions

View file

@ -3095,7 +3095,8 @@ def scourString(in_string, options=None):
# input is a filename
# returns the minidom doc representation of the SVG
def scourXmlFile(filename, options=None):
in_string = open(filename).read()
with open(filename) as f:
in_string = f.read()
out_string = scourString(in_string, options)
return xml.dom.minidom.parseString(out_string.encode('utf-8'))