fix some tests wrt to expecting output now that pytest does no

introduce unwanted "buffering" on "-s" calls.
This commit is contained in:
holger krekel 2013-09-27 12:28:34 +02:00
parent 684d7f8668
commit da7133d201
4 changed files with 13 additions and 13 deletions

View File

@ -1623,7 +1623,7 @@ class FixtureManager:
assert not name.startswith(self._argprefix) assert not name.startswith(self._argprefix)
fixturedef = FixtureDef(self, nodeid, name, obj, fixturedef = FixtureDef(self, nodeid, name, obj,
marker.scope, marker.params, marker.scope, marker.params,
marker.yieldctx, yieldctx=marker.yieldctx,
unittest=unittest) unittest=unittest)
faclist = self._arg2fixturedefs.setdefault(name, []) faclist = self._arg2fixturedefs.setdefault(name, [])
if not fixturedef.has_location: if not fixturedef.has_location:

View File

@ -1993,12 +1993,12 @@ class TestContextManagerFixtureFuncs:
""") """)
result = testdir.runpytest("-s") result = testdir.runpytest("-s")
result.stdout.fnmatch_lines(""" result.stdout.fnmatch_lines("""
setup *setup*
test1 1 *test1 1*
teardown *teardown*
setup *setup*
test2 1 *test2 1*
teardown *teardown*
""") """)
def test_scoped(self, testdir): def test_scoped(self, testdir):
@ -2016,10 +2016,10 @@ class TestContextManagerFixtureFuncs:
""") """)
result = testdir.runpytest("-s") result = testdir.runpytest("-s")
result.stdout.fnmatch_lines(""" result.stdout.fnmatch_lines("""
setup *setup*
test1 1 *test1 1*
test2 1 *test2 1*
teardown *teardown*
""") """)
def test_setup_exception(self, testdir): def test_setup_exception(self, testdir):

View File

@ -28,4 +28,4 @@ def test_fixture_finalizer(testdir):
""")) """))
reprec = testdir.runpytest("-s") reprec = testdir.runpytest("-s")
for test in ['test_browser']: for test in ['test_browser']:
reprec.stdout.fnmatch_lines('Finalized') reprec.stdout.fnmatch_lines('*Finalized*')

View File

@ -672,7 +672,7 @@ def test_fdopen_kept_alive_issue124(testdir):
stdout = k.pop() stdout = k.pop()
stdout.close() stdout.close()
""") """)
result = testdir.runpytest("-s") result = testdir.runpytest()
result.stdout.fnmatch_lines([ result.stdout.fnmatch_lines([
"*2 passed*" "*2 passed*"
]) ])