Skip to content
Browse files

test_submodule: Will now load everything into memory if smmap is pres…

…ent, to help the submodule test to work even on windows
  • Loading branch information...
1 parent e00bf79 commit 4bf372dc4064b1ff30140ab4c11fa6830e695504 @Byron Byron committed Jun 13, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 git/test/objects/
14 git/test/objects/
@@ -9,9 +9,23 @@
import shutil
import git
+import sys
import os
import sys
+# Change the configuration if possible to prevent the underlying memory manager
+# to keep file handles open. On windows we get problems as they are not properly
+# closed due to mmap bugs on windows (as it appears)
+if sys.platform == 'win32':
+ try:
+ import smmap.util
+ smmap.util.MapRegion._test_read_into_memory = True
+ except ImportError:
+ sys.stderr.write("The submodule tests will fail as some files cannot be removed due to open file handles.\n")
+ sys.stderr.write("The latest version of gitdb uses a memory map manager which can be configured to work around this problem")
+#END handle windows platform
class TestRootProgress(RootUpdateProgress):
"""Just prints messages, for now without checking the correctness of the states"""

0 comments on commit 4bf372d

Please sign in to comment.
Something went wrong with that request. Please try again.