123456789101112131415161718192021 |
- 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)
-
|