Преглед на файлове

Go back to old cwd after running doctests.

Jelmer Vernooij преди 13 години
родител
ревизия
4d9710f04c
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      dulwich/tests/__init__.py

+ 2 - 0
dulwich/tests/__init__.py

@@ -104,10 +104,12 @@ def tutorial_test_suite():
         ]
     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)