On Sat, Jan 16, 2010 at 11:59 +0100, Ronny Pfannschmidt wrote:
> On Sat, 2010-01-16 at 11:56 +0100, holger krekel wrote:
> > Moin Ronny,
> > 
> > sorry, i can not reproduce the issue - probably i am missing something. 
> > Could you come up with a minimal example and tell how you 
> > invoke nosetests and py.test?  Maybe also use some paste service 
> > so that they are more nicely readable.  And are you using the released
> > or trunk-nosetests? 
> the issue is vim changing output behaviour based on having a pty on
> stdin

So if i understand it correctly: py.test indeed by default
opens /dev/null and puts that file to sys.stdin (also on fd-level)
so that tests can not hang waiting for input.  I guess
we could introduce an option to leave stdin alone. Alternatively
you could maybe use os.openpty and dup that to filedescriptor 0
before invoking vim-machinery?

cheers,
holger

P.S.: I spent 20+ minutes on this previously - i'd appreciate if you tried
to be a bit more precise than "somehow some output is missing" and a bunch of
tracebacks.  

> > 
> > cheers,
> > holger
> > 
> > On Sat, Jan 16, 2010 at 11:08 +0100, Ronny Pfannschmidt wrote:
> > > hi,
> > > 
> > > while investigating some failing tests for pidas vim integration i
> > > discovered that somehow some output is missing
> > > 
> > > for comparisation
> > > 
> > > /////////////////////////////////////////////////////////////////////////////////////////////
> > > $ py.test
> > > pida::editors::vim::test_pidavim.py::TestVim::test_append_text_at_cursor
> > > inserting into sys.path: /home/ronny/Projects/py
> > > ============================= test session starts
> > > ==============================
> > > python: platform linux2 -- Python 2.6.4 -- pytest-1.2.0a1
> > > test object 1:
> > > pida::editors::vim::test_pidavim.py::TestVim::test_append_text_at_cursor
> > > 
> > > pida/editors/vim/test_pidavim.py E
> > > 
> > > ==================================== ERRORS
> > > ====================================
> > > _____________ ERROR at setup of TestVim.test_append_text_at_cursor
> > > _____________
> > > 
> > > self = <pida.editors.vim.test_pidavim.TestVim object at 0x1874b50>
> > > method = <bound method TestVim.test_append_text_at_cursor of
> > > <pida.editors.vim.test_pidavim.TestVim object at 0x1874b50>>
> > > 
> > >     def setup_method(self, method=None):
> > >         self.vim_process = _start_vim()
> > >         time.sleep(1)
> > > >       self.vim = get_vim('pidatest')
> > > 
> > > pida/editors/vim/test_pidavim.py:51: 
> > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> > > _ _ _ _ 
> > > 
> > > uid = 'pidatest'
> > > 
> > >     def get_vim(uid):
> > >         session = dbus.SessionBus()
> > >         for _try in range(10):
> > >             try:
> > >                 log.debug('trying vim connect #%s', _try)
> > >                 return session.get_object(get_bus_name(uid), '/vim')
> > >             except dbus.DBusException:
> > >                 log.debug('vim connect failed, retrying')
> > >                 time.sleep(0.1)
> > > >       raise RuntimeError('Vim Connect Failed')
> > > E       RuntimeError: Vim Connect Failed
> > > 
> > > pida/editors/vim/client.py:39: RuntimeError
> > > ------------------------------- Captured stdout
> > > --------------------------------
> > > Vim: Caught deadly signal SEGV
> > > 
> > > Vim: Finished.
> > > 
> > > /////////////////////////////////////////////////////////////////////////////////////////////
> > > $ nosetests
> > > pida.editors.vim.test_pidavim:TestVim.test_append_text_at_cursor
> > > beginning vim startup
> > > modules loaded
> > > get uuid
> > > make service
> > > made service
> > > setup gui
> > > done setup gui
> > > Vim: Caught deadly signal SEGV
> > > Vim: Finished.
> > > E
> > > ======================================================================
> > > ERROR: pida.editors.vim.test_pidavim.TestVim.test_append_text_at_cursor
> > > ----------------------------------------------------------------------
> > > Traceback (most recent call last):
> > >   File "/usr/lib64/python2.6/site-packages/nose/case.py", line 364, in
> > > setUp
> > >     try_run(self.inst, ('setup', 'setUp'))
> > >   File "/usr/lib64/python2.6/site-packages/nose/util.py", line 487, in
> > > try_run
> > >     return func()
> > >   File
> > > "/home/ronny/Projects/pida/main/pida/editors/vim/test_pidavim.py", line
> > > 51, in setup_method
> > >     self.vim = get_vim('pidatest')
> > >   File "/home/ronny/Projects/pida/main/pida/editors/vim/client.py", line
> > > 39, in get_vim
> > >     raise RuntimeError('Vim Connect Failed')
> > > RuntimeError: Vim Connect Failed
> > > 
> > > ----------------------------------------------------------------------
> > > Ran 1 test in 2.051s
> > > 
> > > FAILED (errors=1)
> > > /////////////////////////////////////////////////////////////////////////////////////////////
> > > 
> > > i suppose this relates to py.test's output captureing and vim's
> > > behaviour wrt not having a pty
> > > 
> > > any idea how to work around that without just disableing the captureing?
> > > 
> > > Regards Ronnyk
> > > 
> > > _______________________________________________
> > > py-dev mailing list
> > > py-dev@codespeak.net
> > > http://codespeak.net/mailman/listinfo/py-dev
> > > 
> > 
> 

-- 
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to