fix issue93 - hide output of code in early-loaded conftest files

--HG--
branch : trunk
This commit is contained in:
holger krekel
2010-10-24 23:26:14 +02:00
parent f466d35771
commit b4210f3ae0
4 changed files with 28 additions and 5 deletions

View File

@@ -138,15 +138,23 @@ class TestGeneralUsage:
"*Module*test_issue88*",
])
@py.test.mark.xfail
def test_issue93_initialnode_importing_capturing(self, testdir):
testdir.makeconftest("""
print "should not be seen"
print ("should not be seen")
""")
result = testdir.runpytest()
assert result.ret == 0
assert "should not be seen" not in result.stdout.str()
def test_conftest_printing_shows_if_error(self, testdir):
testdir.makeconftest("""
print ("should be seen")
assert 0
""")
result = testdir.runpytest()
assert result.ret != 0
assert "should be seen" in result.stdout.str()
@py.test.mark.skipif("not hasattr(os, 'symlink')")
def test_chdir(self, testdir):
testdir.tmpdir.join("py").mksymlinkto(py._pydir)