[svn r62993] * moving ensuretemp to config object

* adding --basetemp option
* added/rewrote some tests

--HG--
branch : trunk
This commit is contained in:
hpk
2009-03-17 11:29:45 +01:00
parent 6f1eca5e4a
commit 7ed26c2929
7 changed files with 49 additions and 40 deletions

View File

@@ -16,6 +16,17 @@ class TestPyTest:
assert result.stderr.fnmatch_lines([
'config ERROR: hello'
])
def test_basetemp(self, testdir):
mytemp = testdir.tmpdir.mkdir("mytemp")
p = testdir.makepyfile("""
import py
def test_1():
py.test.ensuretemp('xyz')
""")
result = testdir.runpytest(p, '--basetemp=%s' %mytemp)
assert result.ret == 0
assert mytemp.join('xyz').check(dir=1)
def test_assertion_magic(self, testdir):
p = testdir.makepyfile("""