diff --git a/tests/test_repomap.py b/tests/test_repomap.py index b34593221..dc68a4d9d 100644 --- a/tests/test_repomap.py +++ b/tests/test_repomap.py @@ -1,11 +1,24 @@ import os +import tempfile import unittest from unittest.mock import patch from aider.io import InputOutput from aider.repomap import RepoMap -from .utils import IgnorantTemporaryDirectory + +class IgnorantTemporaryDirectory: + def __init__(self): + self.temp_dir = tempfile.TemporaryDirectory() + + def __enter__(self): + return self.temp_dir.__enter__() + + def __exit__(self, exc_type, exc_val, exc_tb): + try: + self.temp_dir.__exit__(exc_type, exc_val, exc_tb) + except OSError: + pass # Ignore errors (Windows) class TestRepoMap(unittest.TestCase): diff --git a/tests/utils.py b/tests/utils.py deleted file mode 100644 index 1629c4425..000000000 --- a/tests/utils.py +++ /dev/null @@ -1,15 +0,0 @@ -import tempfile - - -class IgnorantTemporaryDirectory: - def __init__(self): - self.temp_dir = tempfile.TemporaryDirectory() - - def __enter__(self): - return self.temp_dir.__enter__() - - def __exit__(self, exc_type, exc_val, exc_tb): - try: - self.temp_dir.__exit__(exc_type, exc_val, exc_tb) - except OSError: - pass # Ignore errors (Windows)