Simon Burton | 4 Nov 02:27

[Cython] py.test + cython


I have problems with py.test (all untraceable thanks to py.test's builtin magic)
Looks like it is picking up pyx source files (is this from the module's __file__ ?) and choking.
Does anyone here use py.test ?

Simon.
holger krekel | 4 Nov 03:46
Picon
Favicon

Re: py.test + cython

Hi Simon,

On Tue, Nov 04, 2008 at 12:27 +1100, Simon Burton wrote:
> I have problems with py.test (all untraceable thanks to py.test's builtin magic)
> Looks like it is picking up pyx source files (is this from the module's __file__ ?) and choking.
> Does anyone here use py.test ?

sure - this is a development mailing list for py.test and the py lib. 
normally, py.test wouldn't pick up files with a .pyx extension. 
could you be a bit more specific about what you are doing? 
which version of pyp.test you are using, how output looks like
(even if you think it's not providing enough info or shows "magicness")? 

holger
Simon Burton | 5 Nov 23:31

Re: py.test + cython


$ svn info ~/local/pypy/py/
Path: /home/simon/local/pypy/py
URL: http://codespeak.net/svn/py/dist/py
Repository Root: http://codespeak.net/svn
Repository UUID: fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada
Revision: 59741
Node Kind: directory
Schedule: normal
Last Changed Author: hpk
Last Changed Rev: 58517
Last Changed Date: 2008-10-01 19:24:24 +1000 (Wed, 01 Oct 2008)

traceback:

    def runtraced(self, colitem):
        if self.shouldclose(): 
            raise Exit, "received external close signal" 

        outcome = None 
        colitem.startcapture() 
        try: 
            self.start(colitem)
            try: 
                try:
                    if colitem._stickyfailure: 
                        raise colitem._stickyfailure 
>                   outcome = self.run(colitem) 

/home/simon/local/pypy/py/test/session.py:84:
(Continue reading)

Simon Burton | 6 Nov 01:38

Re: py.test + cython

On Thu, 6 Nov 2008 09:31:12 +1100
Simon Burton <simon <at> arrowtheory.com> wrote:

...
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> 
>     def _getobj(self): 
> E       return self.parent.obj()  
> >       TypeError: __init__() takes exactly 2 arguments (1 given)
> 
> /home/simon/local/pypy/py/test/collect.py:436: TypeError

Aha! Looks like py.test is picking up a class that happened to have prefix Test.
It is not a unit test class (has no test_* methods); i just made sure it could be
constructed with one argument.

Simon.
Lisandro Dalcin | 4 Nov 04:52
Picon
Gravatar

Re: [Cython] py.test + cython

Perhaps this is related to the way Cython implements tracebacks?.
Tracebacks contain references to the pyx files, and then py.test
surely get confused.

On Mon, Nov 3, 2008 at 10:27 PM, Simon Burton <simon@...> wrote:
>
> I have problems with py.test (all untraceable thanks to py.test's builtin magic)
> Looks like it is picking up pyx source files (is this from the module's __file__ ?) and choking.
> Does anyone here use py.test ?
>
> Simon.
> _______________________________________________
> Cython-dev mailing list
> Cython-dev@...
> http://codespeak.net/mailman/listinfo/cython-dev
>

--

-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

Gmane