unexpected pass crashes with junitxml plugin

Create issue
Issue #99 resolved
Former user created an issue

Unexpected pass should cause the tests to report failure, however with the junitxml plugin it crashes with the following:

INTERNALERROR> def append_failure(self, report): INTERNALERROR> self._opentestcase(report) INTERNALERROR> #msg = str(report.longrepr.reprtraceback.extraline) INTERNALERROR> self.appendlog('<failure message="test failure">%s</failure>', INTERNALERROR> > report.longrepr) INTERNALERROR> E AttributeError: 'ItemTestReport' object has no attribute 'longrepr'

Comments (2)

  1. Former user Account Deleted

    It should be possible to consider an unexpected pass as a failure An unexpected pass is considered a failure and will cause pytest to return and exit code of non zero which is good. However it would also be good to be able to see the stdout / stderr and any other information about the test which you normally get when a test fails (of course there won't be a traceback but that's fine and expected).

  2. Holger Krekel repo owner

    This has been fixed in py-trunk yesterday :)

    You may try to already install via "easy_install" or "pip install" http://hudson.testrun.org/view/pytest/job/py-trunk-setup-sdist/lastSuccessfulBuild/artifact/dist/py-1.3.1a1.tar.gz

    Note that i decided to present an unexpectedly passing test as a skipped one in the junitxml reporting. Arguably, xfail-ing tests often are "sometimes-failing" tests and if they sometimes pass it's not really a failure in that respect. Speak up if you see it differently (and maybe register if you want to get notified of improvements).

  3. Log in to comment