From schmir at gmail.com Wed Jun 3 15:33:23 2009 From: schmir at gmail.com (Ralf Schmitt) Date: Wed, 3 Jun 2009 15:33:23 +0200 Subject: [py-dev] pytest_twisted vs generator based tests Message-ID: <932f8baf0906030633u3eaef4dk29753b78e44933d2@mail.gmail.com> Hi, generator based tests do not work with the pytest_twisted plugin (at least if you want to pass arguments) http://bitbucket.org/schmir/py-trunk/changeset/20e64b3893a0/ contains a fix. I'm not quite sure if is correct I've also fixed some typos in comments: http://bitbucket.org/schmir/py-trunk/changeset/4796f75ef7c5/ Regards, - Ralf From schmir at gmail.com Fri Jun 5 11:18:51 2009 From: schmir at gmail.com (Ralf Schmitt) Date: Fri, 5 Jun 2009 11:18:51 +0200 Subject: [py-dev] pytest_twisted vs generator based tests In-Reply-To: <932f8baf0906030633u3eaef4dk29753b78e44933d2@mail.gmail.com> References: <932f8baf0906030633u3eaef4dk29753b78e44933d2@mail.gmail.com> Message-ID: <932f8baf0906050218gc33f338h94df183ebcca1b5e@mail.gmail.com> On Wed, Jun 3, 2009 at 3:33 PM, Ralf Schmitt wrote: > Hi, > > generator based tests do not work with the pytest_twisted plugin (at > least if you want to pass arguments) apparently I've been running the pytest_twisted plugin with a slightly older py lib version. it looks like the plugin architecture has been changed a bit, and pytest_twisted must still be adapted to these changes. I'll try to do that... Regards, - Ralf From schmir at gmail.com Fri Jun 5 12:14:31 2009 From: schmir at gmail.com (Ralf Schmitt) Date: Fri, 5 Jun 2009 12:14:31 +0200 Subject: [py-dev] pytest_twisted vs generator based tests In-Reply-To: <932f8baf0906050218gc33f338h94df183ebcca1b5e@mail.gmail.com> References: <932f8baf0906030633u3eaef4dk29753b78e44933d2@mail.gmail.com> <932f8baf0906050218gc33f338h94df183ebcca1b5e@mail.gmail.com> Message-ID: <932f8baf0906050314g2575f690yddfb5cf18320be95@mail.gmail.com> On Fri, Jun 5, 2009 at 11:18 AM, Ralf Schmitt wrote: > apparently I've been running the pytest_twisted plugin with a slightly > older py lib version. > it looks like the plugin architecture has been changed a bit, and > pytest_twisted must still be adapted to these changes. > I'll try to do that... > I got the pytest_twisted plugin working again: http://bitbucket.org/schmir/py-trunk/changeset/b65184087a6f/ From holger at merlinux.eu Mon Jun 8 16:49:53 2009 From: holger at merlinux.eu (holger krekel) Date: Mon, 8 Jun 2009 16:49:53 +0200 Subject: [py-dev] pytest_twisted vs generator based tests In-Reply-To: <932f8baf0906050314g2575f690yddfb5cf18320be95@mail.gmail.com> References: <932f8baf0906030633u3eaef4dk29753b78e44933d2@mail.gmail.com> <932f8baf0906050218gc33f338h94df183ebcca1b5e@mail.gmail.com> <932f8baf0906050314g2575f690yddfb5cf18320be95@mail.gmail.com> Message-ID: <20090608144953.GQ7437@trillke.net> Hi Ralf, On Fri, Jun 05, 2009 at 12:14 +0200, Ralf Schmitt wrote: > On Fri, Jun 5, 2009 at 11:18 AM, Ralf Schmitt wrote: > > apparently I've been running the pytest_twisted plugin with a slightly > > older py lib version. > > it looks like the plugin architecture has been changed a bit, and > > pytest_twisted must still be adapted to these changes. > > I'll try to do that... > > > > I got the pytest_twisted plugin working again: > > http://bitbucket.org/schmir/py-trunk/changeset/b65184087a6f/ thanks. I reviewed and pulled your changes. I think it makes sense to also pass on kwargs (also called "funcargs" in the docs). Btw, I installed twisted and greenlets and can run the test that is contained in the __init__ file with "py.test ../__init__.py". Probably it'd just be fine to have have a pytest_twisted.py file instead of a package. Feel free to ping me for more changes. best, holger From simon at arrowtheory.com Tue Jun 16 22:27:34 2009 From: simon at arrowtheory.com (Simon Burton) Date: Tue, 16 Jun 2009 16:27:34 -0400 Subject: [py-dev] py.test TypeError Message-ID: <20090616162734.5fc29213.simon@arrowtheory.com> ____________________________________________________________________ FAILURES _____________________________________________________________________ self = > 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 = > def execute(self): > return self.colitem._memocollect() /home/simon/local/pypy/py/test/runner.py:76: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = 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 = , attrname = '_collected', function = > 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 = 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 = 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 = def fget(self): try: return self._obj except AttributeError: > self._obj = obj = self._getobj() /home/simon/local/pypy/py/test/pycollect.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = 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 From holger at merlinux.eu Wed Jun 17 21:00:06 2009 From: holger at merlinux.eu (holger krekel) Date: Wed, 17 Jun 2009 21:00:06 +0200 Subject: [py-dev] py.test TypeError In-Reply-To: <20090616162734.5fc29213.simon@arrowtheory.com> References: <20090616162734.5fc29213.simon@arrowtheory.com> Message-ID: <20090617190006.GE7437@trillke.net> 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 = > > > 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 = > > > def execute(self): > > return self.colitem._memocollect() > > /home/simon/local/pypy/py/test/runner.py:76: > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > self = > > 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 = , attrname = '_collected', function = > > > 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 = > > 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 = > > 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 = > > def fget(self): > try: > return self._obj > except AttributeError: > > self._obj = obj = self._getobj() > > /home/simon/local/pypy/py/test/pycollect.py:30: > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > self = > > 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 From simon at arrowtheory.com Thu Jun 18 00:35:00 2009 From: simon at arrowtheory.com (Simon Burton) Date: Wed, 17 Jun 2009 18:35:00 -0400 Subject: [py-dev] py.test TypeError In-Reply-To: <20090617190006.GE7437@trillke.net> References: <20090616162734.5fc29213.simon@arrowtheory.com> <20090617190006.GE7437@trillke.net> Message-ID: <20090617183500.917c49d3.simon@arrowtheory.com> It was failing for an old version of py lib, and then i ran top of tree and that fails too in the same way. I'm sorry I can't help with the test file (it is a large proprietary blob). On Wed, 17 Jun 2009 21:00:06 +0200 holger krekel wrote: > > Hi Simon, > > can you post a bit more context like the py lib version the test > file/function this refers to? > > holger From holger at merlinux.eu Fri Jun 19 13:21:28 2009 From: holger at merlinux.eu (holger krekel) Date: Fri, 19 Jun 2009 13:21:28 +0200 Subject: [py-dev] 1.0.0b3 released Message-ID: <20090619112128.GI7437@trillke.net> Hello all, i just uploaded a 1.0.0b3 release up to PyPI. This is still The reason being that installing command line scripts on But there is no deep dependency - i.e. you can easily tweak the setup.py file to run without setuptools. What's new with 1.0.0b3, compared to 1.0.0b1? * much improved py.test documentation (http://pytest.org) * Plugins now define hooks directly instead of in a class * there is a new pytest_generate_tests test parametrization hook, see my blog Hope things work for everyone - please let me know of any problems. Next week i'd like to do a 1.0 final. thanks & best, holger -- Metaprogramming, Python, Testing: http://tetamap.wordpress.com Python, PyPy, pytest contracting: http://merlinux.eu From holger at merlinux.eu Fri Jun 19 13:37:48 2009 From: holger at merlinux.eu (holger krekel) Date: Fri, 19 Jun 2009 13:37:48 +0200 Subject: [py-dev] 1.0.0b3 released In-Reply-To: <20090619112128.GI7437@trillke.net> References: <20090619112128.GI7437@trillke.net> Message-ID: <20090619113748.GK7437@trillke.net> n Fri, Jun 19, 2009 at 13:21 +0200, holger krekel wrote: > Hello all, > > i just uploaded a 1.0.0b3 release up to PyPI. This is > still > The reason being that installing command line scripts on editing accident. what i meant is: i just uploaded a 1.0.0b3 release to PyPI. This is still setuptools based because of some issues with installing command line scripts on win32. > But there is no deep dependency - i.e. you can easily tweak > the setup.py file to run without setuptools. > > What's new with 1.0.0b3, compared to 1.0.0b1? > > * much improved py.test documentation (http://pytest.org) > * Plugins now define hooks directly instead of in a class > * there is a new pytest_generate_tests test parametrization > hook, see my blog > > Hope things work for everyone - please let me know of any > problems. Next week i'd like to do a 1.0 final. > > thanks & best, > holger > > -- > Metaprogramming, Python, Testing: http://tetamap.wordpress.com > Python, PyPy, pytest contracting: http://merlinux.eu > _______________________________________________ > 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 From schmir at gmail.com Mon Jun 22 18:42:11 2009 From: schmir at gmail.com (Ralf Schmitt) Date: Mon, 22 Jun 2009 18:42:11 +0200 Subject: [py-dev] 1.0.0b3 released In-Reply-To: <20090619112128.GI7437@trillke.net> References: <20090619112128.GI7437@trillke.net> Message-ID: <932f8baf0906220942kce50f39ncdaa2ed75b2822f2@mail.gmail.com> On Fri, Jun 19, 2009 at 1:21 PM, holger krekel 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? Regards, - Ralf From holger at merlinux.eu Tue Jun 23 10:29:57 2009 From: holger at merlinux.eu (holger krekel) Date: Tue, 23 Jun 2009 10:29:57 +0200 Subject: [py-dev] 1.0.0b3 released In-Reply-To: <932f8baf0906220942kce50f39ncdaa2ed75b2822f2@mail.gmail.com> References: <20090619112128.GI7437@trillke.net> <932f8baf0906220942kce50f39ncdaa2ed75b2822f2@mail.gmail.com> Message-ID: <20090623082957.GM7437@trillke.net> 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 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? FYI, plugins can implement the pytest_namespace(config) hook returning a dict that will thus extend the py.test.* namespace. best, holger From schmir at gmail.com Tue Jun 23 12:40:42 2009 From: schmir at gmail.com (Ralf Schmitt) Date: Tue, 23 Jun 2009 12:40:42 +0200 Subject: [py-dev] 1.0.0b3 released In-Reply-To: <20090623082957.GM7437@trillke.net> References: <20090619112128.GI7437@trillke.net> <932f8baf0906220942kce50f39ncdaa2ed75b2822f2@mail.gmail.com> <20090623082957.GM7437@trillke.net> Message-ID: <932f8baf0906230340q1027d2a8id6f16dd380ef53a0@mail.gmail.com> On Tue, Jun 23, 2009 at 10:29 AM, holger krekel 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 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. BTW, py.test.xfail doesn't work for me too; In [2]: py.test.xfail --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /home/ralf/strtotime/ in () /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 > FYI, plugins can implement the > > ? ?pytest_namespace(config) > > hook returning a dict that will thus extend the py.test.* namespace. > nice. Regards, - Ralf From holger at merlinux.eu Tue Jun 23 15:12:33 2009 From: holger at merlinux.eu (holger krekel) Date: Tue, 23 Jun 2009 15:12:33 +0200 Subject: [py-dev] 1.0.0b3 released In-Reply-To: <932f8baf0906230340q1027d2a8id6f16dd380ef53a0@mail.gmail.com> References: <20090619112128.GI7437@trillke.net> <932f8baf0906220942kce50f39ncdaa2ed75b2822f2@mail.gmail.com> <20090623082957.GM7437@trillke.net> <932f8baf0906230340q1027d2a8id6f16dd380ef53a0@mail.gmail.com> Message-ID: <20090623131233.GP7437@trillke.net> On Tue, Jun 23, 2009 at 12:40 +0200, Ralf Schmitt wrote: > On Tue, Jun 23, 2009 at 10:29 AM, holger krekel 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 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/ in () > > /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 From schmir at gmail.com Wed Jun 24 00:02:29 2009 From: schmir at gmail.com (Ralf Schmitt) Date: Wed, 24 Jun 2009 00:02:29 +0200 Subject: [py-dev] 1.0.0b3 released In-Reply-To: <20090623131233.GP7437@trillke.net> References: <20090619112128.GI7437@trillke.net> <932f8baf0906220942kce50f39ncdaa2ed75b2822f2@mail.gmail.com> <20090623082957.GM7437@trillke.net> <932f8baf0906230340q1027d2a8id6f16dd380ef53a0@mail.gmail.com> <20090623131233.GP7437@trillke.net> Message-ID: <932f8baf0906231502w178befb8i2b0ac7cc046006af@mail.gmail.com> On Tue, Jun 23, 2009 at 3:12 PM, holger krekel wrote: >> 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 :) I didn't actually use it. so feel free to drop it. > > 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? no. > >> BTW, py.test.xfail doesn't work for me too; > > 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?! > no, the interactive session was just a quick test... regards, - ralf From holger at merlinux.eu Wed Jun 24 18:22:54 2009 From: holger at merlinux.eu (holger krekel) Date: Wed, 24 Jun 2009 18:22:54 +0200 Subject: [py-dev] 1.0.0b5 with some fixes uploaded In-Reply-To: <20090619112128.GI7437@trillke.net> References: <20090619112128.GI7437@trillke.net> Message-ID: <20090624162254.GS7437@trillke.net> Hi again, FYI i addressed a few issues from the tracker and uploaded a new 1.0.0b5 release: * remove scope-argument from request.addfinalizer() because request.cached_setup has the scope arg. TOOWTDI. * perform setup finalization before reporting failures * apply modified patches from Andreas Kloeckner to allow test functions to have no func_code (#22) and to make "-k" and function keywords work (#20) * apply isatty patch from Daniel Peolzleithner (issue #23) * resolve issue #18, multiprocessing.Manager() and redirection clash best, holger On Fri, Jun 19, 2009 at 13:21 +0200, holger krekel wrote: > Hello all, > > i just uploaded a 1.0.0b3 release up to PyPI. This is still > The reason being that installing command line scripts on > But there is no deep dependency - i.e. you can easily tweak > the setup.py file to run without setuptools. > > What's new with 1.0.0b3, compared to 1.0.0b1? > > * much improved py.test documentation (http://pytest.org) > * Plugins now define hooks directly instead of in a class > * there is a new pytest_generate_tests test parametrization > hook, see my blog > > Hope things work for everyone - please let me know of any > problems. Next week i'd like to do a 1.0 final. > > thanks & best, > holger > > -- > Metaprogramming, Python, Testing: http://tetamap.wordpress.com > Python, PyPy, pytest contracting: http://merlinux.eu From sridharr at activestate.com Thu Jun 25 21:47:02 2009 From: sridharr at activestate.com (Sridhar Ratnakumar) Date: Thu, 25 Jun 2009 12:47:02 -0700 Subject: [py-dev] py.test - suppressing stdout Message-ID: <4A43D436.7050102@activestate.com> In py.test, is there a way to suppress stdout at all? In my program, if a test fails .. py.test prints a huge amount of text (that the program prints to stdout) .. and I had to scroll back a lot to see the traceback. This is very inconvenient. In most case, I just want to see the traceback along with locals values. From holger at merlinux.eu Thu Jun 25 22:42:05 2009 From: holger at merlinux.eu (holger krekel) Date: Thu, 25 Jun 2009 22:42:05 +0200 Subject: [py-dev] py.test - suppressing stdout In-Reply-To: <4A43D436.7050102@activestate.com> References: <4A43D436.7050102@activestate.com> Message-ID: <20090625204204.GT7437@trillke.net> Hi Sridhar, On Thu, Jun 25, 2009 at 12:47 -0700, Sridhar Ratnakumar wrote: > In py.test, is there a way to suppress stdout at all? > > In my program, if a test fails .. py.test prints a huge amount of text > (that the program prints to stdout) .. and I had to scroll back a lot to > see the traceback. This is very inconvenient. In most case, I just want > to see the traceback along with locals values. yes, makes sense - i had this need myself as well, actually. I'd like to have this and other report customizations be doable through a --report option (and thus also through ENV vars and conftest.py settings). For now, as a kind of workaround, you could put the following lines into a conftest plugin: # example content of conftest.py import py def pytest_runtest_call(__call__, item): cap = py.io.StdCapture() try: return __call__.execute() # call all other hook implementations finally: outerr = cap.reset() # forget about capture if you run your tests now, all capturing should be dropped. does it work for you and is the effect roughly what you want? best, holger > _______________________________________________ > 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 From holger at merlinux.eu Mon Jun 29 13:01:29 2009 From: holger at merlinux.eu (holger krekel) Date: Mon, 29 Jun 2009 13:01:29 +0200 Subject: [py-dev] 1.0.0b6 and xfail/py.test.mark Message-ID: <20090629110129.GC7437@trillke.net> Hi all, i just released a 1.0.0b6 which is hopefully the last beta. Main change to B5: * py.test.xfail is now py.test.mark.xfail * and py.test.mark is back for setting keywords on functions as documented. Andreas Kloeckner pointed me to the fact that py.test.mark *was* documented and he had provided (for b5) a patch which is also in that makes it work correctly with "py.test -k". see http://tinyurl.com/m6wc3b we apologize for any inconvenience. (this is the london underground). holger -- Metaprogramming, Python, Testing: http://tetamap.wordpress.com Python, PyPy, pytest contracting: http://merlinux.eu From SridharR at activestate.com Mon Jun 29 23:08:14 2009 From: SridharR at activestate.com (Sridhar Ratnakumar) Date: Mon, 29 Jun 2009 14:08:14 -0700 Subject: [py-dev] py.test - suppressing stdout In-Reply-To: <20090625204204.GT7437@trillke.net> References: <4A43D436.7050102@activestate.com> <20090625204204.GT7437@trillke.net> Message-ID: On Thu, 25 Jun 2009 13:42:05 -0700, holger krekel wrote: > On Thu, Jun 25, 2009 at 12:47 -0700, Sridhar Ratnakumar wrote: >> In py.test, is there a way to suppress stdout at all? >> >> In my program, if a test fails .. py.test prints a huge amount of text >> (that the program prints to stdout) .. and I had to scroll back a lot to >> see the traceback. This is very inconvenient. In most case, I just want >> to see the traceback along with locals values. > yes, makes sense - i had this need myself as well, actually. > I'd like to have this and other report customizations be > doable through a --report option (and thus also through ENV > vars and conftest.py settings). > For now, as a kind of workaround, you could put the following lines > into a conftest plugin: > # example content of conftest.py > import py > def pytest_runtest_call(__call__, item): > cap = py.io.StdCapture() > try: > return __call__.execute() # call all other hook > implementations > finally: > outerr = cap.reset() # forget about capture > if you run your tests now, all capturing should be dropped. > does it work for you and is the effect roughly what you want? Yes, this does the trick for me (although I would probably modify the code to log stdout to a file insead). Thanks. -srid