diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-05 20:31:40 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-05 20:31:40 +0100 |
commit | d9671e15703918048982c9ff4e2e0fef21ede320 (patch) | |
tree | d3e75e7ea7e41515e07585e571be8366723ef5b4 | |
parent | 46c9a0df4403266a320059eaa66e7dce7b3d9ac4 (diff) | |
download | gitpython-d9671e15703918048982c9ff4e2e0fef21ede320.tar.gz |
fixed test_repo to work on windows
cmd: taskkill now pipes stderror to nul as well
-rw-r--r-- | lib/git/cmd.py | 2 | ||||
-rw-r--r-- | test/git/test_repo.py | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/git/cmd.py b/lib/git/cmd.py index 6d712ca9..bccfb611 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -71,7 +71,7 @@ class Git(object): # for some reason, providing None for stdout/stderr still prints something. This is why # we simply use the shell and redirect to nul. Its slower than CreateProcess, question # is whether we really want to see all these messages. Its annoying no matter what. - subprocess.call(("TASKKILL /F /T /PID %s > nul" % str(self.proc.pid)), shell=True) + subprocess.call(("TASKKILL /F /T /PID %s 2>nul 1>nul" % str(self.proc.pid)), shell=True) # END exception handling def __getattr__(self, attr): diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 0b196a1f..93ab7a90 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -7,15 +7,14 @@ import os, sys from test.testlib import * from git import * +from git.utils import join_path_native +import tempfile class TestRepo(TestBase): @raises(InvalidGitRepositoryError) def test_new_should_raise_on_invalid_repo_location(self): - if sys.platform == "win32": - Repo("C:\\WINDOWS\\Temp") - else: - Repo("/tmp") + Repo(tempfile.gettempdir()) @raises(NoSuchPathError) def test_new_should_raise_on_non_existant_path(self): @@ -220,7 +219,8 @@ class TestRepo(TestBase): def test_untracked_files(self): base = self.rorepo.git.git_dir - files = (base+"/__test_myfile", base+"/__test_other_file") + files = ( join_path_native(base, "__test_myfile"), + join_path_native(base, "__test_other_file") ) num_recently_untracked = 0 try: for fpath in files: @@ -233,7 +233,7 @@ class TestRepo(TestBase): # assure we have all names - they are relative to the git-dir num_test_untracked = 0 for utfile in untracked_files: - num_test_untracked += os.path.join(base, utfile) in files + num_test_untracked += join_path_native(base, utfile) in files assert len(files) == num_test_untracked finally: for fpath in files: |