소스 검색

Import path.

Jelmer Vernooij 3 년 전
부모
커밋
ae3e7f9252
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      dulwich/tests/test_repository.py

+ 3 - 2
dulwich/tests/test_repository.py

@@ -647,7 +647,8 @@ exit 0
             self.skipTest("shell hook tests requires POSIX shell")
 
         pre_commit_contents = """#!%(executable)s
-import os
+import sys
+sys.path.extend(':'.join(%(path)s))
 from dulwich.repo import Repo
 
 with open('foo', 'w') as f:
@@ -655,7 +656,7 @@ with open('foo', 'w') as f:
 
 r = Repo('.')
 r.stage(['foo'])
-""" % {'executable': sys.executable}
+""" % {'executable': sys.executable, 'path': repr(sys.path)}
 
         repo_dir = os.path.join(self.mkdtemp())
         self.addCleanup(shutil.rmtree, repo_dir)