--- 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.
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to