alfredodeza / pytest.vim

Runs your UnitTests with py.test displaying red/green bars and errors
274 stars 40 forks source link

SyntaxError causes no session, breaks reporting #66

Closed alfredodeza closed 3 years ago

alfredodeza commented 6 years ago

Ran a test that called a very broken class method, the parser was not able to produce meaningful messages (failed to parse, please see session). Was only visible with :Pytest method verbose:

Traceback (most recent call last):
  File "/Users/alfredo/.virtualenvs/ceph-volume/lib/python2.7/site-packages/_pytest/config.py", line 364, in _importconftest
    mod = conftestpath.pyimport()
  File "/Users/alfredo/.virtualenvs/ceph-volume/lib/python2.7/site-packages/py/_path/local.py", line 668, in pyimport
    __import__(modname)
  File "/Users/alfredo/.virtualenvs/ceph-volume/lib/python2.7/site-packages/_pytest/assertion/rewrite.py", line 212, in load_module
    py.builtin.exec_(co, mod.__dict__)
  File "/Users/alfredo/.virtualenvs/ceph-volume/lib/python2.7/site-packages/py/_builtin.py", line 221, in exec_
    exec2(obj, globals, locals)
  File "<string>", line 7, in exec2
  File "/Users/alfredo/python/ceph/src/ceph-volume/ceph_volume/tests/conftest.py", line 3, in <module>
    from ceph_volume.api import lvm as lvm_api
  File "/Users/alfredo/python/ceph/src/ceph-volume/ceph_volume/api/lvm.py", line 868
    pass
       ^
SyntaxError: invalid syntax
ERROR: could not load /Users/alfredo/python/ceph/src/ceph-volume/ceph_volume/tests/conftest.py