| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fa70623 commit 7bbaac2
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,9 +12,11 @@ | |||
| 12 | 12 | ||
| 13 | 13 | from io import BytesIO | |
| 14 | 14 | import os | |
| 15 | + import sys | ||
| 15 | 16 | import subprocess | |
| 16 | 17 | ||
| 17 | 18 | from git.util import IndexFileSHA1Writer | |
| 19 | + from git.cmd import Git | ||
| 18 | 20 | from git.exc import ( | |
| 19 | 21 | UnmergedEntriesError, | |
| 20 | 22 | HookExecutionError | |
@@ -74,7 +76,9 @@ def run_commit_hook(name, index): | |||
| 74 | 76 | stdout=subprocess.PIPE, | |
| 75 | 77 | stderr=subprocess.PIPE, | |
| 76 | 78 | cwd=index.repo.working_dir, | |
| 77 | - close_fds=(os.name == 'posix')) | ||
| 79 | + close_fds=(os.name == 'posix'), | ||
| 80 | + universal_newlines=True, | ||
| 81 | + creationflags=Git.CREATE_NO_WINDOW if sys.platform == 'win32' else 0,) | ||
| 78 | 82 | stdout, stderr = cmd.communicate() | |
| 79 | 83 | cmd.stdout.close() | |
| 80 | 84 | cmd.stderr.close() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,7 @@ | |||
| 7 | 7 | import os | |
| 8 | 8 | import sys | |
| 9 | 9 | import tempfile | |
| 10 | + from unittest import skipIf | ||
| 10 | 11 | ||
| 11 | 12 | import git.objects.base as base | |
| 12 | 13 | from git.test.lib import ( | |
@@ -116,6 +117,8 @@ def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo): | |||
| 116 | 117 | assert rw_remote_repo.config_reader("repository").getboolean("core", "bare") | |
| 117 | 118 | assert os.path.isdir(os.path.join(rw_repo.working_tree_dir, 'lib')) | |
| 118 | 119 | ||
| 120 | + @skipIf(sys.version_info < (3, ) and os.name == 'nt', | ||
| 121 | + "Unicode woes, see https://github.com/gitpython-developers/GitPython/pull/519") | ||
| 119 | 122 | @with_rw_repo('0.1.6') | |
| 120 | 123 | def test_add_unicode(self, rw_repo): | |
| 121 | 124 | filename = u"שלום.txt" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -239,6 +239,8 @@ def counter_stderr(line): | |||
| 239 | 239 | stdout=subprocess.PIPE, | |
| 240 | 240 | stderr=subprocess.PIPE, | |
| 241 | 241 | shell=False, | |
| 242 | + universal_newlines=True, | ||
| 243 | + creationflags=Git.CREATE_NO_WINDOW if sys.platform == 'win32' else 0, | ||
| 242 | 244 | ) | |
| 243 | 245 | ||
| 244 | 246 | handle_process_output(proc, counter_stdout, counter_stderr, lambda proc: proc.wait()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,7 @@ | |||
| 27 | 27 | from git.compat import string_types | |
| 28 | 28 | ||
| 29 | 29 | import time | |
| 30 | + import sys | ||
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | 33 | class TestIterableMember(object): | |
@@ -90,7 +91,11 @@ def test_blocking_lock_file(self): | |||
| 90 | 91 | wait_lock = BlockingLockFile(my_file, 0.05, wait_time) | |
| 91 | 92 | self.failUnlessRaises(IOError, wait_lock._obtain_lock) | |
| 92 | 93 | elapsed = time.time() - start | |
| 93 | - assert elapsed <= wait_time + 0.02, elapsed # some extra time it may cost | ||
| 94 | + # More extra time costs, but... | ||
| 95 | + extra_time = 0.2 | ||
| 96 | + if sys.platform == 'win32': | ||
| 97 | + extra_time *= 4 | ||
| 98 | + self.assertLess(elapsed, wait_time + 0.02) | ||
| 94 | 99 | ||
| 95 | 100 | def test_user_id(self): | |
| 96 | 101 | assert '@' in get_user_id() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments