File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 77
88import contextlib
99from functools import wraps
10- import sys
10+ import gc
1111import io
1212import logging
1313import os
14+ import sys
1415import tempfile
1516import textwrap
1617import time
1718
1819from git .compat import string_types , is_win
1920from git .util import rmtree , cwd
21+ import gitdb
2022
2123import os .path as osp
24+
25+
2226if sys .version_info [0 :2 ] == (2 , 6 ):
2327 import unittest2 as unittest
2428else :
@@ -96,7 +100,6 @@ def wrapper(self):
96100 # a windows-only issue. In fact things should be deleted, as well as
97101 # memory maps closed, once objects go out of scope. For some reason
98102 # though this is not the case here unless we collect explicitly.
99- import gc
100103 gc .collect ()
101104 if not keep :
102105 rmtree (path )
@@ -144,9 +147,10 @@ def repo_creator(self):
144147 os .chdir (prev_cwd )
145148 rw_repo .git .clear_cache ()
146149 rw_repo = None
147- import gc
148- gc .collect ()
149150 if repo_dir is not None :
151+ gc .collect ()
152+ gitdb .util .mman .collect ()
153+ gc .collect ()
150154 rmtree (repo_dir )
151155 # END rm test repo if possible
152156 # END cleanup
@@ -303,7 +307,8 @@ def remote_repo_creator(self):
303307 rw_daemon_repo .git .clear_cache ()
304308 del rw_repo
305309 del rw_daemon_repo
306- import gc
310+ gc .collect ()
311+ gitdb .util .mman .collect ()
307312 gc .collect ()
308313 if rw_repo_dir :
309314 rmtree (rw_repo_dir )
@@ -357,7 +362,6 @@ def setUpClass(cls):
357362 each test type has its own repository
358363 """
359364 from git import Repo
360- import gc
361365 gc .collect ()
362366 cls .rorepo = Repo (GIT_REPO )
363367
You can’t perform that action at this time.
0 commit comments