don't remove symlinks from temporary directory path - should help with some standard OSX setups
This commit is contained in:
parent
d4fe273b2f
commit
077c468589
|
@ -1,2 +1,2 @@
|
|||
#
|
||||
__version__ = '2.1.4.dev1'
|
||||
__version__ = '2.1.4.dev2'
|
||||
|
|
|
@ -46,7 +46,7 @@ class TempdirHandler:
|
|||
|
||||
def finish(self):
|
||||
self.trace("finish")
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
mp = monkeypatch()
|
||||
t = TempdirHandler(config)
|
||||
|
@ -64,5 +64,5 @@ def pytest_funcarg__tmpdir(request):
|
|||
name = request._pyfuncitem.name
|
||||
name = py.std.re.sub("[\W]", "_", name)
|
||||
x = request.config._tmpdirhandler.mktemp(name, numbered=True)
|
||||
return x.realpath()
|
||||
return x
|
||||
|
||||
|
|
2
setup.py
2
setup.py
|
@ -24,7 +24,7 @@ def main():
|
|||
name='pytest',
|
||||
description='py.test: simple powerful testing with Python',
|
||||
long_description = long_description,
|
||||
version='2.1.4.dev1',
|
||||
version='2.1.4.dev2',
|
||||
url='http://pytest.org',
|
||||
license='MIT license',
|
||||
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
||||
|
|
|
@ -75,3 +75,16 @@ def test_basetemp(testdir):
|
|||
result = testdir.runpytest(p, '--basetemp=%s' % mytemp)
|
||||
assert result.ret == 0
|
||||
assert mytemp.join('hello').check()
|
||||
|
||||
@pytest.mark.skipif("not hasattr(os, 'symlink')")
|
||||
def test_tmpdir_keeps_symlinks(testdir):
|
||||
realtemp = testdir.tmpdir.mkdir("myrealtemp")
|
||||
linktemp = testdir.tmpdir.join("symlinktemp")
|
||||
linktemp.mksymlinkto(realtemp)
|
||||
p = testdir.makepyfile("""
|
||||
def test_1(tmpdir):
|
||||
import os
|
||||
assert os.path.realpath(str(tmpdir)) != str(tmpdir)
|
||||
""")
|
||||
result = testdir.runpytest("-s", p, '--basetemp=%s/bt' % linktemp)
|
||||
assert not result.ret
|
||||
|
|
Loading…
Reference in New Issue