py.test can stop with no output

Issue #94 resolved
Amaury Forgeot d'Arc
created an issue

To reproduce: in current pypy (r74497), add a new AppTest:


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!)

Comments (2)

  1. Log in to comment