[py-dev] New issue 94 in py-trunk: py.test can stop with no output

issues-noreply at bitbucket.org issues-noreply at bitbucket.org
Wed May 12 11:59:49 CEST 2010


--- you can reply above this line ---

New issue 94: py.test can stop with no output
http://bitbucket.org/hpk42/py-trunk/issue/94/pytest-can-stop-with-no-output

amauryfa on Wed, 12 May 2010 11:59:48 +0200:

Description:
  To reproduce: in current pypy (r74497), add a new AppTest:
{{{
#!python
class AppTest: 
    def test_raises(self):
        raises(ValueError, "x")
}}}

You may have to run the test twice to get the problem.

This triggers three bugs in various places:
* pypy uses __file__ to create traceback entries, which may end in '.pyc' (the normal way is to use co_filename, which is always a '.py')
* then py.test attempts to get the source code, but opens the .pyc file, and calls syntax_checker(). This fails of course and leads to a pile of INTERNALERROR lines.
* then pytest_capture is lost: pytest_runtest_makereport failed, suspendcapture() is not called, and the next call to resumecapture() will raise the error
"cannot resume, already capturing with 'no'".

I think all three places should be modified (and it's not only pypy's fault!)

Responsible:
  hpk42
-- 
This is an issue notification from bitbucket.org.
You are receiving this either because you are the
owner of the issue, or you are following the issue.



More information about the Pytest-dev mailing list