Просмотр исходного кода

Add patch to cope with cwd errors from testsuite.

Jelmer Vernooij 13 лет назад
Родитель
Сommit
6f543de3b8
2 измененных файлов с 22 добавлено и 0 удалено
  1. 21 0
      debian/patches/01_reset_chdir
  2. 1 0
      debian/patches/series

+ 21 - 0
debian/patches/01_reset_chdir

@@ -0,0 +1,21 @@
+Description: Reset current working directory after running doctests
+Author: Jelmer Vernooij <jelmer@debian.org>
+Status: Cherry-picked from upstream, will be in 0.8.2
+
+=== modified file 'dulwich/tests/__init__.py'
+--- old/dulwich/tests/__init__.py	2011-08-21 21:37:18 +0000
++++ new/dulwich/tests/__init__.py	2011-11-01 11:30:18 +0000
+@@ -104,10 +104,12 @@
+         ]
+     tutorial_files = ["../../docs/tutorial/%s.txt" % name for name in tutorial]
+     def setup(test):
++        test.__old_cwd = os.getcwd()
+         test.__dulwich_tempdir = tempfile.mkdtemp()
+         os.chdir(test.__dulwich_tempdir)
+     def teardown(test):
+         shutil.rmtree(test.__dulwich_tempdir)
++        os.chdir(test.__old_cwd)
+     return doctest.DocFileSuite(setUp=setup, tearDown=teardown,
+         *tutorial_files)
+ 
+

+ 1 - 0
debian/patches/series

@@ -0,0 +1 @@
+01_reset_chdir