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

New issue 128: py.test does not show SyntaxErrors when using --pdb
http://bitbucket.org/hpk42/py-trunk/issue/128/pytest-does-not-show-syntaxerrors-when-using

Antonio Cuni / antocuni on Thu, 7 Oct 2010 14:48:00 +0200:

Description:
  If the test file contains a SyntaxError, py.test --pdb silently fails without 
telling anything about the cause:

{{{
$ cat test_syntax_error.py 
a =
$ py.test test_syntax_error.py 
================================= test session starts 
==================================
platform linux2 -- Python 2.6.5 -- pytest-1.4.0a1

/tmp/foo/test_syntax_error.py E
test path 1: test_syntax_error.py

======================================== ERRORS 
========================================
____________________ ERROR collecting /tmp/foo/test_syntax_error.py 
____________________
/home/antocuni/pypy/misc/py-trunk/py/_plugin/pytest_python.py:216: in 
_importtestmodule
>           mod = self.fspath.pyimport(ensuresyspath=True)
/home/antocuni/pypy/misc/py-trunk/py/_path/local.py:530: in pyimport
>           mod = __import__(modname, None, None, ['__doc__'])
E             File "/tmp/foo/test_syntax_error.py", line 1
E               a =
E                 ^
E           SyntaxError: invalid syntax
=============================== 1 error in 0.02 seconds 
================================
$ py.test test_syntax_error.py --pdb
================================= test session starts 
==================================
platform linux2 -- Python 2.6.5 -- pytest-1.4.0a1

/tmp/foo/test_syntax_error.py E
test path 1: test_syntax_error.py

=============================== 1 error in 0.04 seconds 
================================
$ 
}}}




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