summaryrefslogtreecommitdiff
path: root/git/test/test_submodule.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-06-13 14:55:24 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-06-13 15:06:20 +0200
commit48fab54afab49f18c260463a79b90d594c7a5833 (patch)
treebf97639c024c3f6358f71da70ac278d313bc72a2 /git/test/test_submodule.py
parent4a8bdce7a665a0b38fc822b7f05a8c2e80ccd781 (diff)
downloadgitpython-48fab54afab49f18c260463a79b90d594c7a5833.tar.gz
test_submodule: Will now load everything into memory if smmap is present, to help the submodule test to work even on windows
Diffstat (limited to 'git/test/test_submodule.py')
-rw-r--r--git/test/test_submodule.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py
index d44d026b..cc35caf5 100644
--- a/git/test/test_submodule.py
+++ b/git/test/test_submodule.py
@@ -8,8 +8,22 @@ from git.objects.submodule.root import RootModule, RootUpdateProgress
from git.util import to_native_path_linux, join_path_native
import shutil
import git
+import sys
import os
+# 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"""