File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import contextlib
9
9
from functools import wraps
10
- import sys
10
+ import gc
11
11
import io
12
12
import logging
13
13
import os
14
+ import sys
14
15
import tempfile
15
16
import textwrap
16
17
import time
17
18
18
19
from git .compat import string_types , is_win
19
20
from git .util import rmtree , cwd
21
+ import gitdb
20
22
21
23
import os .path as osp
24
+
25
+
22
26
if sys .version_info [0 :2 ] == (2 , 6 ):
23
27
import unittest2 as unittest
24
28
else :
@@ -96,7 +100,6 @@ def wrapper(self):
96
100
# a windows-only issue. In fact things should be deleted, as well as
97
101
# memory maps closed, once objects go out of scope. For some reason
98
102
# though this is not the case here unless we collect explicitly.
99
- import gc
100
103
gc .collect ()
101
104
if not keep :
102
105
rmtree (path )
@@ -144,9 +147,10 @@ def repo_creator(self):
144
147
os .chdir (prev_cwd )
145
148
rw_repo .git .clear_cache ()
146
149
rw_repo = None
147
- import gc
148
- gc .collect ()
149
150
if repo_dir is not None :
151
+ gc .collect ()
152
+ gitdb .util .mman .collect ()
153
+ gc .collect ()
150
154
rmtree (repo_dir )
151
155
# END rm test repo if possible
152
156
# END cleanup
@@ -303,7 +307,8 @@ def remote_repo_creator(self):
303
307
rw_daemon_repo .git .clear_cache ()
304
308
del rw_repo
305
309
del rw_daemon_repo
306
- import gc
310
+ gc .collect ()
311
+ gitdb .util .mman .collect ()
307
312
gc .collect ()
308
313
if rw_repo_dir :
309
314
rmtree (rw_repo_dir )
@@ -357,7 +362,6 @@ def setUpClass(cls):
357
362
each test type has its own repository
358
363
"""
359
364
from git import Repo
360
- import gc
361
365
gc .collect ()
362
366
cls .rorepo = Repo (GIT_REPO )
363
367
You can’t perform that action at this time.
0 commit comments