On Tue, Jun 23, 2009 at 12:40 +0200, Ralf Schmitt wrote:
> On Tue, Jun 23, 2009 at 10:29 AM, holger krekel<hol...@merlinux.eu> wrote:
> > Hi Ralf,
> >
> > On Mon, Jun 22, 2009 at 18:42 +0200, Ralf Schmitt wrote:
> >> On Fri, Jun 19, 2009 at 1:21 PM, holger krekel<hol...@merlinux.eu> wrote:
> >> > Hope things work for everyone - please let me know of any
> >> > problems.  Next week i'd like to do a 1.0 final.
> >>
> >> py.test.mark isn't there:
> >>
> >> xfail = py.test.mark.xfail("expected failure")
> >> E   AttributeError: mark
> >>
> >> Is this intended?
> >
> > it's now py.test.xfail("expected failure").  Did you find
> > some rogue link/documentation about this  Or was it just
> > that i missed pointing that out in the CHANGELOG?
> >
> 
> I didn't even notice there is a CHANGELOG :)
> 
> Anyway, this only gives me py.test.xfail and not mark.

1. mark is not there, indeed.  We could do a plugin
   that provides py.test.mark - as it was undocumented 
   and not much advertised yet so i didn't think there 
   would be users :) 

2. py.test.xfail does not take arguments anymore - 
   see http://tinyurl.com/nxqta2 
   I basically stripped the py.test.xfail decorator to the bare 
   minimum of marking a function as expected-to-fail. 
   do you have a need for it to take a message argument? 

> BTW, py.test.xfail doesn't work for me too;
> 
> In [2]: py.test.xfail
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
> 
> /home/ralf/strtotime/<ipython console> in <module>()
> 
> /home/ralf/py26/lib/python2.6/site-packages/py-1.0.0b3-py2.6.egg/py/initpkg.pyc
> in __getattr__(self, name)
>     182             except KeyError:
>     183                 __tracebackhide__ = True
> --> 184                 raise AttributeError(name)
>     185             else:
>     186                 result = self.__pkg__._resolve(extpy)
> 
> AttributeError: xfail

Hum, this happens in an interactive session because plugins
are not activated and there is no py.test.xfail entry.  
If you issue

>>> py.test.config.parse([])
>>> py.test.config.pluginmanager.do_configure(py.test.config)

the default plugins will be activated and py.test.xfail
becomes visible.  Would you like this incantation to live in
a "py.test.init()" helper?!

> > FYI, plugins can implement the
> >
> >    pytest_namespace(config)
> >
> > hook returning a dict that will thus extend the py.test.* namespace.
> >
> 
> nice.

with the above "interactive" caveat, though. 

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

Reply via email to