Fixed a test that was failing on Windows.

master
Pacman Ghost 3 years ago
parent 6d59d6244c
commit e5872248a6
  1. 4
      vasl_templates/webapp/tests/control_tests_servicer.py
  2. 7
      vasl_templates/webapp/vasl_mod.py

@ -174,6 +174,10 @@ class ControlTestsServicer( BaseControlTestsServicer ): #pylint: disable=too-man
"""End a test run."""
self._log_request( request, context )
# end the test run
# NOTE: If the active VaslMod has loaded any extension files from our temp directory, since they are
# kept open for the duration, we need to clean up the VaslMod (so that it will close these files),
# otherwise we may not be able to clean up our temp file directory.
webapp_vasl_mod.set_vasl_mod( None, None )
self.cleanup()
return Empty()

@ -172,6 +172,13 @@ class VaslMod:
if self.vasl_version not in SUPPORTED_VASL_MOD_VERSIONS:
_logger.warning( "Unsupported VASL version: %s", self.vasl_version )
def __del__( self ):
# clean up
# NOTE: We keep our module and extension ZIP files open for the duration (so we can
# read images out of them on demand), so we need to make sure we close them here.
for f in self._files:
f[0].close()
def get_piece_image( self, gpid, side, index ):
"""Get the image for the specified piece."""

Loading…
Cancel
Save