Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf241808

Browse files
committed
Simplify test of refresh that should succeed
shutil.which does not always find the git that Popen would run, atleast on Windows, but it is no worse than running a "command -v" or"where" command as was previously done here via os.popen.
1 parentba4cbae commitf241808

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎test/test_git.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ def test_refresh_bad_git_path(self):
310310
self.assertRaises(GitCommandNotFound,refresh,"yada")
311311

312312
deftest_refresh_good_git_path(self):
313-
which_cmd="where"ifos.name=="nt"else"command -v"
314-
path=os.popen("{0} git".format(which_cmd)).read().strip().split("\n")[0]
313+
path=shutil.which("git")
315314
refresh(path)
316315

317316
deftest_options_are_passed_to_git(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp