allow to run py.test.cmdline.main() multiple times.

--HG--
branch : trunk
This commit is contained in:
holger krekel
2010-05-11 19:56:22 +02:00
parent 0f5ed3abc7
commit 8ba2a98e11
6 changed files with 33 additions and 7 deletions

View File

@@ -89,3 +89,19 @@ class TestGeneralUsage:
assert result.ret == 0
s = result.stdout.str()
assert 'MarkGenerator' in s
def test_double_pytestcmdline(self, testdir):
p = testdir.makepyfile(run="""
import py
py.test.cmdline.main()
py.test.cmdline.main()
""")
testdir.makepyfile("""
def test_hello():
pass
""")
result = testdir.runpython(p)
result.stdout.fnmatch_lines([
"*1 passed*",
"*1 passed*",
])