fix issue49 - avoid confusing errors when initialization goes wrong

This commit is contained in:
holger krekel
2011-06-01 14:54:34 +02:00
parent 67859158d4
commit e3b2792677
2 changed files with 21 additions and 3 deletions
+13
View File
@@ -259,6 +259,19 @@ class TestGeneralUsage:
if name.startswith("pytest_"):
assert value.__doc__, "no docstring for %s" % name
def test_initialization_error_issue49(self, testdir):
testdir.makeconftest("""
def pytest_configure():
x
""")
result = testdir.runpytest()
assert result.ret == 3 # internal error
result.stderr.fnmatch_lines([
"INTERNAL*pytest_configure*",
"INTERNAL*x*",
])
assert 'sessionstarttime' not in result.stderr.str()
class TestInvocationVariants:
def test_earlyinit(self, testdir):
p = testdir.makepyfile("""