|
7 | 7 |
|
8 | 8 | importcontextlib
|
9 | 9 | fromfunctoolsimportwraps
|
10 |
| -importsys |
| 10 | +importgc |
11 | 11 | importio
|
12 | 12 | importlogging
|
13 | 13 | importos
|
| 14 | +importsys |
14 | 15 | importtempfile
|
15 | 16 | importtextwrap
|
16 | 17 | importtime
|
17 | 18 |
|
18 | 19 | fromgit.compatimportstring_types,is_win
|
19 | 20 | fromgit.utilimportrmtree,cwd
|
| 21 | +importgitdb |
20 | 22 |
|
21 | 23 | importos.pathasosp
|
| 24 | + |
| 25 | + |
22 | 26 | ifsys.version_info[0:2]== (2,6):
|
23 | 27 | importunittest2asunittest
|
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 |
| -importgc |
100 | 103 | gc.collect()
|
101 | 104 | ifnotkeep:
|
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 |
| -importgc |
148 |
| -gc.collect() |
149 | 150 | ifrepo_dirisnotNone:
|
| 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 | delrw_repo
|
305 | 309 | delrw_daemon_repo
|
306 |
| -importgc |
| 310 | +gc.collect() |
| 311 | +gitdb.util.mman.collect() |
307 | 312 | gc.collect()
|
308 | 313 | ifrw_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 | fromgitimportRepo
|
360 |
| -importgc |
361 | 365 | gc.collect()
|
362 | 366 | cls.rorepo=Repo(GIT_REPO)
|
363 | 367 |
|
|