close the open cache files, so Windows won't error

This commit is contained in:
Paul Gauthier 2023-07-13 16:02:29 -07:00
parent 24015dab5f
commit 8e2b92febb

View file

@ -33,6 +33,9 @@ class TestRepoMap(unittest.TestCase):
self.assertIn("test_file3.md", result)
self.assertIn("test_file4.json", result)
# close the open cache files, so Windows won't error
del repo_map
def test_get_repo_map_with_identifiers(self):
# Create a temporary directory with a sample Python file containing identifiers
test_file1 = "test_file_with_identifiers.py"
@ -83,6 +86,9 @@ print(my_function(3, 4))
self.assertIn("my_function", result)
self.assertIn("test_file_pass.py", result)
# close the open cache files, so Windows won't error
del repo_map
def test_check_for_ctags_failure(self):
with patch("subprocess.run") as mock_run:
mock_run.side_effect = Exception("ctags not found")
@ -133,6 +139,7 @@ print(my_function(3, 4))
for file in test_files:
self.assertIn(file, result)
# close the open cache files, so Windows won't error
del repo_map