Skip to content

Commit

Permalink
Must remove loader from scope to clean up on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
malthe committed Dec 12, 2023
1 parent 06ea885 commit ea9b56a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/chameleon/tests/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def _test_load_package(self, command, pkg_extension):
zipimport.zipimporter(
str(package_path)).load_module('chameleon_test_pkg')

loader = self._makeOne(auto_reload=True)
try:
# we use auto_reload to trigger a call of mtime
loader = self._makeOne(auto_reload=True)
result = self._load(
loader, 'chameleon_test_pkg:templates/test.pt')
self.assertIsNone(result._v_last_read)
Expand All @@ -108,6 +108,7 @@ def _test_load_package(self, command, pkg_extension):
self.assertEqual(result._v_last_read, old_v_last_read)
finally:
# cleanup
del loader
sys.modules.pop('chameleon_test_pkg', None)


Expand Down

0 comments on commit ea9b56a

Please sign in to comment.