From 3910abfc2ab12a5d5a210b71c43b7a2318311323 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sat, 22 Oct 2016 03:40:01 +0200 Subject: [PATCH 1/2] submodule-TCs: stop monekypatching smmap.MapRegion with files in Windows Obviously it is not needed anymore, or nothing is worse without this monkeypatch. --- git/test/test_submodule.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index fcaad04ba..e9fd81539 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -38,20 +38,6 @@ import os.path as osp -# 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 is_win: - try: - import smmap.util # @UnusedImport - 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""" From 9db2ff10e59b2657220d1804df19fcf946539385 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sat, 22 Oct 2016 14:48:40 +0200 Subject: [PATCH 2/2] fix(win_mmap): unmark hidden win_errors due to smmap unicode foes Now 2 more TCs pass in Windows: + TestRepo.test_file_handle_leaks() + TestObjDbPerformance.test_random_access() See https://github.com/gitpython-developers/smmap/pull/30 --- git/test/performance/test_odb.py | 6 ------ git/test/test_repo.py | 2 -- git/test/test_submodule.py | 1 - 3 files changed, 9 deletions(-) diff --git a/git/test/performance/test_odb.py b/git/test/performance/test_odb.py index 3879cb087..425af84a5 100644 --- a/git/test/performance/test_odb.py +++ b/git/test/performance/test_odb.py @@ -3,10 +3,6 @@ import sys from time import time -from unittest.case import skipIf - -from git.compat import PY3 -from git.util import HIDE_WINDOWS_KNOWN_ERRORS from .lib import ( TestBigRepoR @@ -15,8 +11,6 @@ class TestObjDBPerformance(TestBigRepoR): - @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and PY3, - "FIXME: smmp fails with: TypeError: Can't convert 'bytes' object to str implicitly") def test_random_access(self): results = [["Iterate Commits"], ["Iterate Blobs"], ["Retrieve Blob Data"]] for repo in (self.gitrorepo, self.puregitrorepo): diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 8b644f7ff..374a26eee 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -808,8 +808,6 @@ def test_git_file(self, rwrepo): git_file_repo = Repo(rwrepo.working_tree_dir) self.assertEqual(osp.abspath(git_file_repo.git_dir), real_path_abs) - @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and PY3, - "FIXME: smmp fails with: TypeError: Can't convert 'bytes' object to str implicitly") def test_file_handle_leaks(self): def last_commit(repo, rev, path): commit = next(repo.iter_commits(rev, path, max_count=1)) diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index e9fd81539..53f3c352c 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -9,7 +9,6 @@ from git.cmd import Git from git.compat import ( string_types, - is_win, ) from git.exc import ( InvalidGitRepositoryError,