Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork944
Commit8bbcb26
committed
Call repo.close() instead of manually collecting
The code this replaces in the `commit` pytest fixture seems not tobe needed anymore, and could arguably be removed now with nofurther related changes. But whether it is needed depends onsubtle and sometimes nondeterministic factors, and may also varyacross Python versions.To be safe, this replaces it with a call to the Repo instance'sclose method, which is in effect more robust than what was beingdone before, as it calls clear_cache on the the Git object that theRepo object uses, does a gitdb/smmap collection, and on Windowscalls gc.collect both before and after that collection.This may happen immediately anyway if the Repo object is notreachable from any cycle, since the reference count should go tozero after each of the deprecation warning tests (the fixture'slifetime is that of the test case), and Repo.close is called inRepo.__del__. But this makes it happen immediately even if there isa cycle.1 parentca385a5 commit8bbcb26
1 file changed
+1
-3
lines changedLines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
8 | 7 |
| |
9 | 8 |
| |
10 | 9 |
| |
| |||
31 | 30 |
| |
32 | 31 |
| |
33 | 32 |
| |
34 |
| - | |
35 |
| - | |
| 33 | + | |
36 | 34 |
| |
37 | 35 |
| |
38 | 36 |
| |
|
0 commit comments
Comments
(0)