[py-dev] py.test TypeError
holger krekel
holger at merlinux.eu
Wed Jun 17 21:00:06 CEST 2009
Hi Simon,
can you post a bit more context like the py lib version the test
file/function this refers to?
holger
On Tue, Jun 16, 2009 at 16:27 -0400, Simon Burton wrote:
> ____________________________________________________________________ FAILURES _____________________________________________________________________
>
> self = <CollectorRunner colitem=<Instance '()'>>
>
> def run(self):
> """ return result of running setup, execution, teardown procedures. """
> excinfo = None
> res = NORESULT
> capture = self.getcapture()
> try:
> try:
> when = "setup"
> self.setup()
> try:
> > res = self.execute()
>
> /home/simon/local/pypy/py/test/runner.py:37:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <CollectorRunner colitem=<Instance '()'>>
>
> def execute(self):
> > return self.colitem._memocollect()
>
> /home/simon/local/pypy/py/test/runner.py:76:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <Instance '()'>
>
> def _memocollect(self):
> """ internal helper method to cache results of calling collect(). """
> > return self._memoizedcall('_collected', self.collect)
>
> /home/simon/local/pypy/py/test/collect.py:350:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <Instance '()'>, attrname = '_collected', function = <bound method Instance.collect of <Instance '()'>>
>
> def _memoizedcall(self, attrname, function):
> exattrname = "_ex_" + attrname
> failure = getattr(self, exattrname, None)
> if failure is not None:
> raise failure[0], failure[1], failure[2]
> if hasattr(self, attrname):
> return getattr(self, attrname)
> try:
> > res = function()
>
> /home/simon/local/pypy/py/test/collect.py:146:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <Instance '()'>
>
> def collect(self):
> l = self._deprecated_collect()
> if l is not None:
> return l
> > name2items = self._buildname2items()
>
> /home/simon/local/pypy/py/test/pycollect.py:115:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <Instance '()'>
>
> def _buildname2items(self):
> # NB. we avoid random getattrs and peek in the __dict__ instead
> d = {}
> > dicts = [getattr(self.obj, '__dict__', {})]
>
> /home/simon/local/pypy/py/test/pycollect.py:123:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <Instance '()'>
>
> def fget(self):
> try:
> return self._obj
> except AttributeError:
> > self._obj = obj = self._getobj()
>
> /home/simon/local/pypy/py/test/pycollect.py:30:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = <Instance '()'>
>
> def _getobj(self):
> > return self.parent.obj()
> E TypeError: function takes exactly 1 argument (0 given)
>
> /home/simon/local/pypy/py/test/pycollect.py:219: TypeError
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev
>
--
Metaprogramming, Python, Testing: http://tetamap.wordpress.com
Python, PyPy, pytest contracting: http://merlinux.eu
More information about the Pytest-dev
mailing list