Skip to content

Commit

Permalink
Merge pull request #25 from yarikoptic/master
Browse files Browse the repository at this point in the history
Generated temp directory should have real (dereferenced) path
  • Loading branch information
mih committed Aug 21, 2015
2 parents 2f2b0f6 + 6912194 commit 770edf4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion testkraut/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ def with_tempdir(*targs, **tkwargs):
def decorate(func):
def newfunc(*arg, **kwargs):
import tempfile
wdir = tempfile.mkdtemp(*targs, **tkwargs)
from os.path import realpath
# realpath so the logic about relative paths do not break
# when TMPDIR is pointing to a directory which is a symlink.
# This is just a workaround for
# https://github.com/neurodebian/testkraut/issues/24
wdir = realpath(tempfile.mkdtemp(*targs, **tkwargs))
try:
func(*((wdir,) + arg), **kwargs)
finally:
Expand Down

0 comments on commit 770edf4

Please sign in to comment.