xpass tests don't cause non-zero exit codes

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-10-22 12:00:17 +02:00
parent 76a1bf391e
commit 1999180dfd
5 changed files with 5 additions and 4 deletions

View File

@ -20,6 +20,7 @@ Changes between 1.3.4 and 2.0.0dev0
- fix issue88 (finding custom test nodes from command line arg)
- refine 'tmpdir' creation, will now create basenames better associated
with test names (thanks Ronny)
- "xpass" (unexpected pass) tests don't cause exitcode!=0
Changes between 1.3.3 and 1.3.4
----------------------------------------------

View File

@ -5,7 +5,7 @@ see http://pytest.org for documentation and details
(c) Holger Krekel and others, 2004-2010
"""
__version__ = "2.0.0.dev1"
__version__ = "2.0.0.dev3"
__all__ = ['config', 'cmdline']

View File

@ -106,7 +106,7 @@ class Session(object):
self.collection = Collection(config) # XXX move elswehre
def pytest_runtest_logreport(self, report):
if report.failed:
if report.failed and 'xfail' not in report.keywords:
self._testsfailed += 1
maxfail = self.config.getvalue("maxfail")
if maxfail and self._testsfailed >= maxfail:

View File

@ -22,7 +22,7 @@ def main():
name='pytest',
description='py.test: simple powerful testing with Python',
long_description = long_description,
version= '2.0.0.dev1',
version= '2.0.0.dev3',
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],

View File

@ -218,7 +218,7 @@ class TestXFail:
"*XPASS*test_that*",
"*1 xpassed*"
])
assert result.ret == 1
assert result.ret == 0
def test_xfail_imperative(self, testdir):
p = testdir.makepyfile("""