[svn r62982] report basic configuration errors more gracefully to the user

--HG--
branch : trunk
This commit is contained in:
hpk
2009-03-17 08:03:49 +01:00
parent 771ce92fdf
commit bbdebac87a
3 changed files with 29 additions and 8 deletions

View File

@@ -5,6 +5,18 @@ pytestpath = pydir.join("bin", "py.test")
EXPECTTIMEOUT=10.0
class TestPyTest:
def test_config_error(self, testdir):
testdir.makeconftest("""
class ConftestPlugin:
def pytest_configure(self, config):
raise config.Error("hello")
""")
result = testdir.runpytest(testdir.tmpdir)
assert result.ret != 0
assert result.stderr.fnmatch_lines([
'config ERROR: hello'
])
def test_assertion_magic(self, testdir):
p = testdir.makepyfile("""
def test_this():
@@ -17,7 +29,7 @@ class TestPyTest:
"E assert 0",
])
assert result.ret == 1
def test_collectonly_simple(self, testdir):
p = testdir.makepyfile("""
def test_func1():