mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
latest changes
This commit is contained in:
@@ -147,6 +147,12 @@ class DjangoDataDrivenTestCase(DataDrivenTestCase):
|
||||
self.old_cwd = os.getcwd()
|
||||
|
||||
self.tmpdir = tempfile.TemporaryDirectory(prefix='mypy-test-')
|
||||
tmpdir_root = os.path.join(self.tmpdir.name, 'tmp')
|
||||
|
||||
new_files = []
|
||||
for path, contents in self.files:
|
||||
new_files.append((path, contents.replace('<TMP>', tmpdir_root)))
|
||||
self.files = new_files
|
||||
|
||||
os.chdir(self.tmpdir.name)
|
||||
os.mkdir(test_temp_dir)
|
||||
@@ -179,7 +185,7 @@ class DjangoDataDrivenTestCase(DataDrivenTestCase):
|
||||
self.clean_up.append((True, d))
|
||||
self.clean_up.append((False, path))
|
||||
|
||||
sys.path.insert(0, os.path.join(self.tmpdir.name, 'tmp'))
|
||||
sys.path.insert(0, tmpdir_root)
|
||||
|
||||
def teardown(self):
|
||||
if hasattr(self, 'old_environ'):
|
||||
|
||||
Reference in New Issue
Block a user