From oliver.schoenborn at gmail.com Fri Apr 1 17:22:05 2016 From: oliver.schoenborn at gmail.com (oliver) Date: Fri, 1 Apr 2016 17:22:05 -0400 Subject: [pytest-dev] ANN: nose2pytest 1.0 In-Reply-To: References: Message-ID: On Fri, Apr 1, 2016 at 2:42 AM, Thomas De Schampheleire < patrickdepinguin at gmail.com> wrote: > Hi Oliver, > > On Fri, Apr 1, 2016 at 6:17 AM, oliver > wrote: > > Thomas, is your idea that given test code like this: > > > > from unittest.case import TestCase > > class YourTestCase(TestCase): > > def setUp(self): > > do stuff > > def test1(self): > > a, b = 2, 1 > > self.assertGreater(a, b) > > > > > > you would prefer to convert to what, something like this: > > > > from unittest.case import TestCase > > class YourTestCase(TestCase): > > def setup_method(self): > > do stuff > > def test1(self): > > a, b = 2, 1 > > assert a > b > > > > > > Am i understanding correctly? > > Yes, indeed. Although that I think that to allow the setup_method > calls you can no longer inherit from unittest. In my case, we had: > > class YourTestCase(TestController) > > where TestController is unittest-based which I am replacing to > > class YourTestCase(TestControllerPytest) > > But that last type of conversion is probably impossible for a general > script like nose2pytest, so I can imagine I'll do that conversion > manually. > DId you mean TestCase? Can you provide more detail, this looks like a straight rename. Removing the base class is definitely possible, and I believe the two unittest2pytest do this, have you tried them? > > Do you think the assert conversion is possible? > For sure, but as Florian pointed out, this already seems possible via unittest2pytest, is there something that nose2pytest does for nose tests that neither of the 2 unittest2pytest do for unittest tests? Oliver -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Thu Apr 7 06:29:02 2016 From: holger at merlinux.eu (holger krekel) Date: Thu, 7 Apr 2016 12:29:02 +0200 Subject: [pytest-dev] planet pytest Message-ID: <20160407102902.GE3558@uwanda> Hi pytest-devers, as there are many blog posts on pytest out there i am wondering if we could inaugurate a "planet.pytest.org" site which aggregates those blog posts. I haven't administered such a site myself but through rackspace open source funding i can provide a dedicated VM which can host it and we could point the "planet.pytest.org" DNS entry to it. ASFAIK planet or blog aggregation software can pull posts according to tags or categories, e.g. here would be mine: http://holgerkrekel.net/feed/?tag=pytest Is anyone up for setting up a planet VM, using our logo and maybe a bit of the current rough layout? Ideally this setup would be done by Ansible or Saltstack so that we can recreate the site from a few deployment files. best, holger P.S.: intend to finalize some details regarding the sprint, probably posting them next week. From rpfannsc at redhat.com Thu Apr 7 07:08:13 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Thu, 7 Apr 2016 13:08:13 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: <20160407102902.GE3558@uwanda> References: <20160407102902.GE3558@uwanda> Message-ID: sounds good, reminds me i should blog some more, too On Thu, Apr 7, 2016 at 12:29 PM, holger krekel wrote: > Hi pytest-devers, > > as there are many blog posts on pytest out there i am wondering > if we could inaugurate a "planet.pytest.org" site which aggregates > those blog posts. I haven't administered such a site myself > but through rackspace open source funding i can provide a dedicated > VM which can host it and we could point the "planet.pytest.org" > DNS entry to it. ASFAIK planet or blog aggregation software > can pull posts according to tags or categories, e.g. here would > be mine: > > http://holgerkrekel.net/feed/?tag=pytest > > Is anyone up for setting up a planet VM, using our logo > and maybe a bit of the current rough layout? Ideally this > setup would be done by Ansible or Saltstack so that we can > recreate the site from a few deployment files. > > best, > holger > > P.S.: intend to finalize some details regarding the sprint, > probably posting them next week. > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Thu Apr 7 08:36:35 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Thu, 07 Apr 2016 12:36:35 +0000 Subject: [pytest-dev] planet pytest In-Reply-To: References: <20160407102902.GE3558@uwanda> Message-ID: On Thu, Apr 7, 2016 at 8:11 AM Ronny Pfannschmidt wrote: > sounds good, reminds me i should blog some more, too > > On Thu, Apr 7, 2016 at 12:29 PM, holger krekel wrote: > >> Hi pytest-devers, >> >> as there are many blog posts on pytest out there i am wondering >> if we could inaugurate a "planet.pytest.org" site which aggregates >> those blog posts. > > Great idea! It also seems like an opportunity for people to contribute to pytest but that don't have experience with the code base yet but knows some web programming. :) Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhunt at mozilla.com Thu Apr 7 08:51:44 2016 From: dhunt at mozilla.com (Dave Hunt) Date: Thu, 7 Apr 2016 13:51:44 +0100 Subject: [pytest-dev] planet pytest In-Reply-To: References: <20160407102902.GE3558@uwanda> Message-ID: <240BFDBA-0385-4361-947F-F9EDD83F3CDD@mozilla.com> Great idea! I can throw in http://blargon7.com/tag/pytest/ > On 7 Apr 2016, at 13:36, Bruno Oliveira wrote: > > On Thu, Apr 7, 2016 at 8:11 AM Ronny Pfannschmidt > wrote: > sounds good, reminds me i should blog some more, too > > On Thu, Apr 7, 2016 at 12:29 PM, holger krekel > wrote: > Hi pytest-devers, > > as there are many blog posts on pytest out there i am wondering > if we could inaugurate a "planet.pytest.org " site which aggregates > those blog posts. > > Great idea! > > It also seems like an opportunity for people to contribute to pytest but that don't have experience with the code base yet but knows some web programming. :) > > Bruno. > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From raphael at hackebrot.de Fri Apr 8 10:06:46 2016 From: raphael at hackebrot.de (Raphael Pierzina) Date: Fri, 8 Apr 2016 15:06:46 +0100 Subject: [pytest-dev] planet pytest In-Reply-To: <20160407102902.GE3558@uwanda> References: <20160407102902.GE3558@uwanda> Message-ID: All of http://hackebrot.github.io/pytest-tricks/ is about pytest :) I warmly welcome anyone of you to contribute and join Bruno and myself. Submit a PR at https://github.com/hackebrot/pytest-tricks/ Best, Raphael > On 07 Apr 2016, at 11:29, holger krekel wrote: > > Hi pytest-devers, > > as there are many blog posts on pytest out there i am wondering > if we could inaugurate a "planet.pytest.org" site which aggregates > those blog posts. I haven't administered such a site myself > but through rackspace open source funding i can provide a dedicated > VM which can host it and we could point the "planet.pytest.org" > DNS entry to it. ASFAIK planet or blog aggregation software > can pull posts according to tags or categories, e.g. here would > be mine: > > http://holgerkrekel.net/feed/?tag=pytest > > Is anyone up for setting up a planet VM, using our logo > and maybe a bit of the current rough layout? Ideally this > setup would be done by Ansible or Saltstack so that we can > recreate the site from a few deployment files. > > best, > holger > > P.S.: intend to finalize some details regarding the sprint, > probably posting them next week. > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.schulze at gmx.net Fri Apr 8 10:21:23 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Fri, 08 Apr 2016 16:21:23 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: References: <20160407102902.GE3558@uwanda> Message-ID: <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> I talked to Holger and will setup a Planet VM over the weekend. If it goes as planned, there will be a repository where people can make a PR to add their feed and the rest is automatic. If it's not fully automatic, it will at least be very easy to update :) Regards, Florian Schulze On 8 Apr 2016, at 16:06, Raphael Pierzina wrote: > All of http://hackebrot.github.io/pytest-tricks/ > is about pytest :) > > I warmly welcome anyone of you to contribute and join Bruno and > myself. > > Submit a PR at https://github.com/hackebrot/pytest-tricks/ > > > Best, > Raphael > >> On 07 Apr 2016, at 11:29, holger krekel wrote: >> >> Hi pytest-devers, >> >> as there are many blog posts on pytest out there i am wondering >> if we could inaugurate a "planet.pytest.org" site which aggregates >> those blog posts. I haven't administered such a site myself >> but through rackspace open source funding i can provide a dedicated >> VM which can host it and we could point the "planet.pytest.org" >> DNS entry to it. ASFAIK planet or blog aggregation software >> can pull posts according to tags or categories, e.g. here would >> be mine: >> >> http://holgerkrekel.net/feed/?tag=pytest >> >> Is anyone up for setting up a planet VM, using our logo >> and maybe a bit of the current rough layout? Ideally this >> setup would be done by Ansible or Saltstack so that we can >> recreate the site from a few deployment files. >> >> best, >> holger >> >> P.S.: intend to finalize some details regarding the sprint, >> probably posting them next week. >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev From nicoddemus at gmail.com Fri Apr 8 10:27:19 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Fri, 08 Apr 2016 14:27:19 +0000 Subject: [pytest-dev] planet pytest In-Reply-To: <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> Message-ID: On Fri, Apr 8, 2016 at 11:21 AM Florian Schulze wrote: > I talked to Holger and will setup a Planet VM over the weekend. If it > goes as planned, there will be a repository where people can make a PR > to add their feed and the rest is automatic. If it's not fully > automatic, it will at least be very easy to update :) > Oh there's a framework ready for that? Nice, didn't know. :) Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.schulze at gmx.net Sun Apr 10 15:14:22 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Sun, 10 Apr 2016 21:14:22 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> Message-ID: <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> Hi! The planet setup is accessible at http://162.242.211.211 for now and the repository at https://github.com/fschulze/planet.pytest.org The feeds are updated every hour. You can add your blogs to https://github.com/fschulze/planet.pytest.org/blob/master/feeds.cfg and make a PR. There currently is a problem with the HTML rendering. The HTML of the blog posts is supposed to be normalized, so that tags are closed properly. It looks like that doesn't work correctly. There currently seem to be too few closing divs, causing the sidebar to be at the wrong place in the DOM and not being rendered. Instead of using Venus, I'll look into using http://www.planetplanet.org like planetpython.org. Is there anything security critical running on *.pytest.org? If so we should rethink using planet.pytest.org to prevent any possibility of JS injection and cookie compromise. When this setup is finished, I'd like to transfer the repository to the pytest-dev organization. I'll add proper documentation before that. Regards, Florian Schulze From patrickdepinguin at gmail.com Sun Apr 10 15:26:39 2016 From: patrickdepinguin at gmail.com (Thomas De Schampheleire) Date: Sun, 10 Apr 2016 21:26:39 +0200 Subject: [pytest-dev] Converting unittest to pytest (was: Re: ANN: nose2pytest 1.0) In-Reply-To: <20160331083631.GO25141@tonks> References: <20160331083631.GO25141@tonks> Message-ID: Hi Florian, On Thu, Mar 31, 2016 at 10:36 AM, Florian Bruhin wrote: > Hey Thomas, > > * Thomas De Schampheleire [2016-03-31 10:23:00 +0200]: >> On Thu, Mar 31, 2016 at 6:04 AM, oliver wrote: >> > Announcing a project hosted on GitHub called nose2pytest >> > (https://github.com/schollii/nose2pytest). This project helps migrate a test >> > suite that was written for Nose to work with pure pytest. It converts >> > nose.tools.assert_ functions into raw assert statements so you can better >> > (IMO) leverage pytest assertion introspection. It may even decrease test >> > suite dependencies by 1; after nose2test has been run on a test suite, it is >> > no longer needed. >> > >> > The nose2pytest script has already successfully converted approximately 5000 >> > assertions, so this is v1.0. However, there are many ways to harness Nose >> > functionality so I'm really curious to see if nose2test can be useful to >> > others. >> > >> > I'm sure there is lots of room for improvement. Any feedback or >> > contributions would be much appreciated. >> > >> >> [...] >> >> I had a very brief look at your nose2pytest code, and at first sight >> it doesn't look complicated to support a unittest2pytest conversion >> too? What do you think of that? > > There are already two of those: > > https://github.com/pytest-dev/unittest2pytest > https://github.com/dropbox/unittest2pytest > Ah, thanks! I was not aware of these. Then it makes no sense in adapting nose2pytest, I will try out these suggestions. Thanks a lot, Thomas From oliver.schoenborn at gmail.com Mon Apr 11 00:23:14 2016 From: oliver.schoenborn at gmail.com (oliver) Date: Mon, 11 Apr 2016 00:23:14 -0400 Subject: [pytest-dev] submitting nose2pytest for inclusion in pytest Message-ID: I'd like to submit nose2pytest for inclusion in pytest, it is at https://github.com/schollii/nose2pytest. With v1.0.5 a pip install installs a nose2pytest executable script that does the conversion, and a plugin (via setuptools hook) so that some assert functions that can't be converted to raw assertions can still be used without needing nose to be installed on the system. Oliver Open Source contributions: PyPubSub , nose2pytest , Lua-iCxx , iof StackOverflow contributions -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Mon Apr 11 00:41:51 2016 From: me at the-compiler.org (Florian Bruhin) Date: Mon, 11 Apr 2016 06:41:51 +0200 Subject: [pytest-dev] submitting nose2pytest for inclusion in pytest In-Reply-To: References: Message-ID: <20160411044151.GY25141@tonks> Hey Oliver, * oliver [2016-04-11 00:23:14 -0400]: > I'd like to submit nose2pytest for inclusion in pytest, it is at > https://github.com/schollii/nose2pytest. With v1.0.5 a pip install installs > a nose2pytest executable script that does the conversion, and a plugin (via > setuptools hook) so that some assert functions that can't be converted to > raw assertions can still be used without needing nose to be installed on > the system. I'm assuming you mean pytest-dev (the group on GitHub), not pytest itself? In that case, +1 from me. Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I'm running a crowdfunding to work on my FOSS-project full-time: http://igg.me/at/qutebrowser -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From holger at merlinux.eu Mon Apr 11 05:12:30 2016 From: holger at merlinux.eu (holger krekel) Date: Mon, 11 Apr 2016 11:12:30 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> Message-ID: <20160411091230.GB12415@uwanda> Hi Florian, On Sun, Apr 10, 2016 at 21:14 +0200, Florian Schulze wrote: > Hi! > > The planet setup is accessible at http://162.242.211.211 for now and > the repository at https://github.com/fschulze/planet.pytest.org very cool, thanks! I tentatively added a DNS entry so that http://planet.pytest.org works for now. > The feeds are updated every hour. > > You can add your blogs to > https://github.com/fschulze/planet.pytest.org/blob/master/feeds.cfg > and make a PR. looking forward to seeing more diverse blog post sources soon (hint hint ... go!). > There currently is a problem with the HTML rendering. The HTML of > the blog posts is supposed to be normalized, so that tags are closed > properly. It looks like that doesn't work correctly. There currently > seem to be too few closing divs, causing the sidebar to be at the > wrong place in the DOM and not being rendered. > > Instead of using Venus, I'll look into using > http://www.planetplanet.org like planetpython.org. sounds good, maybe the above rendering problem goes away then. > Is there anything security critical running on *.pytest.org? If so > we should rethink using planet.pytest.org to prevent any possibility > of JS injection and cookie compromise. So far pytest.org is not using cookies, logins etc so we should be fine for now. We could also go for another domains sometime. I'd like to bring pytest DNS entries into more collective ownership -- maybe a little topic for the sprint. > When this setup is finished, I'd like to transfer the repository to > the pytest-dev organization. I'll add proper documentation before > that. sounds good. Adding https/letsencrypt would be a nice convenience but not urgent from my side. holger > Regards, > Florian Schulze > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev From florian.schulze at gmx.net Mon Apr 11 06:40:37 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Mon, 11 Apr 2016 12:40:37 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: <20160411091230.GB12415@uwanda> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> Message-ID: <5C9B89CD-536E-4CDA-B9BC-7B14877F1ED8@gmx.net> On 11 Apr 2016, at 11:12, holger krekel wrote: >> When this setup is finished, I'd like to transfer the repository to >> the pytest-dev organization. I'll add proper documentation before >> that. > > sounds good. Adding https/letsencrypt would be a nice convenience > but not urgent from my side. I doubt it would be very useful, because outside http resources are embedded and probably blocked by browsers. Regards, Florian Schulze From me at the-compiler.org Mon Apr 11 07:37:01 2016 From: me at the-compiler.org (Florian Bruhin) Date: Mon, 11 Apr 2016 13:37:01 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: <20160411091230.GB12415@uwanda> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> Message-ID: <20160411113701.GA25141@tonks> Hey, * holger krekel [2016-04-11 11:12:30 +0200]: > On Sun, Apr 10, 2016 at 21:14 +0200, Florian Schulze wrote: > > Hi! > > > > The planet setup is accessible at http://162.242.211.211 for now and > > the repository at https://github.com/fschulze/planet.pytest.org > > very cool, thanks! > > I tentatively added a DNS entry so that > > http://planet.pytest.org > > works for now. Thanks to everyone involved! Already a lot of interesting (even if old) content there :) > > The feeds are updated every hour. > > > > You can add your blogs to > > https://github.com/fschulze/planet.pytest.org/blob/master/feeds.cfg > > and make a PR. > > looking forward to seeing more diverse blog post sources soon > (hint hint ... go!). I'll check if I find some other interesting blogs with pytest content :) Some which come to mind: http://hackebrot.github.io/pytest-tricks/ http://pythontesting.net/category/framework/pytest/ http://blog.devork.be/ if it had a pytest tag (hint, hint) https://blog.dbrgn.ch/tags/pytest/ I found some more via a "inurl:tag/pytest" search on google, but most of them seem inactive or have only one post related to pytest. As for myself, http://blog.the-compiler.org/ is quite dead (no post in 2015... argh). But when I'm working full-time on qutebrowser (somewhen in June/July/September) I'll also start a (daily-ish) development/progress blog for it. I'll make sure I add a pytest tag and add it to the list then! Florian (the other one :P) -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I'm running a crowdfunding to work on my FOSS-project full-time: http://igg.me/at/qutebrowser -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From florian.schulze at gmx.net Mon Apr 11 12:25:38 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Mon, 11 Apr 2016 18:25:38 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: <20160411113701.GA25141@tonks> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> <20160411113701.GA25141@tonks> Message-ID: On 11 Apr 2016, at 13:37, Florian Bruhin wrote: > I'll check if I find some other interesting blogs with pytest content > :) > > Some which come to mind: > > http://hackebrot.github.io/pytest-tricks/ This doesn't seem to have a feed. > http://pythontesting.net/category/framework/pytest/ Add it like this: [http://pythontesting.net/category/framework/pytest/feed/] title = Python Testing link = http://pythontesting.net/category/framework/pytest/ > http://blog.devork.be/ if it had a pytest tag (hint, hint) It has labels, but there doesn't seem to be a feed for labels. > https://blog.dbrgn.ch/tags/pytest/ PR for that merged. I switched from genshi to the default planet template thingy and that seems to got rid of the rendering issues. Regards, Florian Schulze From raphael at hackebrot.de Mon Apr 11 16:51:29 2016 From: raphael at hackebrot.de (Raphael Pierzina) Date: Mon, 11 Apr 2016 21:51:29 +0100 Subject: [pytest-dev] planet pytest In-Reply-To: References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> <20160411113701.GA25141@tonks> Message-ID: <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> Now pytest-tricks does have a feed https://github.com/fschulze/planet.pytest.org/pull/4 :D > On 11 Apr 2016, at 17:25, Florian Schulze wrote: > > > > On 11 Apr 2016, at 13:37, Florian Bruhin wrote: > >> I'll check if I find some other interesting blogs with pytest content >> :) >> >> Some which come to mind: >> >> http://hackebrot.github.io/pytest-tricks/ > > This doesn't seem to have a feed. > >> http://pythontesting.net/category/framework/pytest/ > > Add it like this: > > [http://pythontesting.net/category/framework/pytest/feed/] > title = Python Testing > link = http://pythontesting.net/category/framework/pytest/ > >> http://blog.devork.be/ if it had a pytest tag (hint, hint) > > It has labels, but there doesn't seem to be a feed for labels. > >> https://blog.dbrgn.ch/tags/pytest/ > > PR for that merged. > > > I switched from genshi to the default planet template thingy and that seems to got rid of the rendering issues. > > Regards, > Florian Schulze > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Mon Apr 11 16:56:15 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Mon, 11 Apr 2016 20:56:15 +0000 Subject: [pytest-dev] planet pytest In-Reply-To: <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> <20160411113701.GA25141@tonks> <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> Message-ID: Nice, subscribed! :) On Mon, Apr 11, 2016 at 5:51 PM Raphael Pierzina wrote: > Now pytest-tricks does have a feed > https://github.com/fschulze/planet.pytest.org/pull/4 :D > > On 11 Apr 2016, at 17:25, Florian Schulze wrote: > > > > On 11 Apr 2016, at 13:37, Florian Bruhin wrote: > > I'll check if I find some other interesting blogs with pytest content > :) > > Some which come to mind: > > http://hackebrot.github.io/pytest-tricks/ > > > This doesn't seem to have a feed. > > http://pythontesting.net/category/framework/pytest/ > > > Add it like this: > > [http://pythontesting.net/category/framework/pytest/feed/] > title = Python Testing > link = http://pythontesting.net/category/framework/pytest/ > > http://blog.devork.be/ if it had a pytest tag (hint, hint) > > > It has labels, but there doesn't seem to be a feed for labels. > > https://blog.dbrgn.ch/tags/pytest/ > > > PR for that merged. > > > I switched from genshi to the default planet template thingy and that > seems to got rid of the rendering issues. > > Regards, > Florian Schulze > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brianna.laugher at gmail.com Tue Apr 12 00:19:38 2016 From: brianna.laugher at gmail.com (Brianna Laugher) Date: Tue, 12 Apr 2016 14:19:38 +1000 Subject: [pytest-dev] planet pytest In-Reply-To: References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> <20160411113701.GA25141@tonks> <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> Message-ID: Nice! Could someone add a link to the github repo/instructions about how to add a new feed, and maybe also an explicit link to the planet rss feed? Cheers Brianna On 12/04/2016 7:00 AM, "Bruno Oliveira" wrote: > Nice, subscribed! :) > > On Mon, Apr 11, 2016 at 5:51 PM Raphael Pierzina > wrote: > >> Now pytest-tricks does have a feed >> https://github.com/fschulze/planet.pytest.org/pull/4 :D >> >> On 11 Apr 2016, at 17:25, Florian Schulze >> wrote: >> >> >> >> On 11 Apr 2016, at 13:37, Florian Bruhin wrote: >> >> I'll check if I find some other interesting blogs with pytest content >> :) >> >> Some which come to mind: >> >> http://hackebrot.github.io/pytest-tricks/ >> >> >> This doesn't seem to have a feed. >> >> http://pythontesting.net/category/framework/pytest/ >> >> >> Add it like this: >> >> [http://pythontesting.net/category/framework/pytest/feed/] >> title = Python Testing >> link = http://pythontesting.net/category/framework/pytest/ >> >> http://blog.devork.be/ if it had a pytest tag (hint, hint) >> >> >> It has labels, but there doesn't seem to be a feed for labels. >> >> https://blog.dbrgn.ch/tags/pytest/ >> >> >> PR for that merged. >> >> >> I switched from genshi to the default planet template thingy and that >> seems to got rid of the rendering issues. >> >> Regards, >> Florian Schulze >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev >> >> >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev >> > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.schulze at gmx.net Tue Apr 12 02:15:44 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Tue, 12 Apr 2016 08:15:44 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> <20160411113701.GA25141@tonks> <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> Message-ID: <0B531CA0-A5FE-49B4-8221-B5A051431DAC@gmx.net> On 12 Apr 2016, at 6:19, Brianna Laugher wrote: > Nice! Could someone add a link to the github repo/instructions about how to > add a new feed, and maybe also an explicit link to the planet rss feed? On my todo list already :) Regards, Florian Schulze From holger at merlinux.eu Tue Apr 12 05:21:45 2016 From: holger at merlinux.eu (Holger Krekel) Date: Tue, 12 Apr 2016 11:21:45 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> <20160411113701.GA25141@tonks> <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> Message-ID: <7B144263-22D8-4571-B5CB-F6C1310552C6@merlinux.eu> Hey Florian, all, is it possible that posts are sorted by the original posting date (which is already displayed)? Is it possible to on your show the title and first Para of posts but not the full text of each post on the default home page? (I'd prefer that personally) Best and thanks, holger On April 11, 2016 10:51:29 PM GMT+02:00, Raphael Pierzina wrote: >Now pytest-tricks does have a feed >https://github.com/fschulze/planet.pytest.org/pull/4 > :D > >> On 11 Apr 2016, at 17:25, Florian Schulze >wrote: >> >> >> >> On 11 Apr 2016, at 13:37, Florian Bruhin wrote: >> >>> I'll check if I find some other interesting blogs with pytest >content >>> :) >>> >>> Some which come to mind: >>> >>> http://hackebrot.github.io/pytest-tricks/ >> >> This doesn't seem to have a feed. >> >>> http://pythontesting.net/category/framework/pytest/ >> >> Add it like this: >> >> [http://pythontesting.net/category/framework/pytest/feed/] >> title = Python Testing >> link = http://pythontesting.net/category/framework/pytest/ >> >>> http://blog.devork.be/ if it had a pytest tag (hint, hint) >> >> It has labels, but there doesn't seem to be a feed for labels. >> >>> https://blog.dbrgn.ch/tags/pytest/ >> >> PR for that merged. >> >> >> I switched from genshi to the default planet template thingy and that >seems to got rid of the rendering issues. >> >> Regards, >> Florian Schulze >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev > > > >------------------------------------------------------------------------ > >_______________________________________________ >pytest-dev mailing list >pytest-dev at python.org >https://mail.python.org/mailman/listinfo/pytest-dev -- Sent using mobile touch keys, increased chances for errors and misunderstandings. Enjoy! -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.schulze at gmx.net Tue Apr 12 12:00:05 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Tue, 12 Apr 2016 18:00:05 +0200 Subject: [pytest-dev] planet pytest In-Reply-To: <7B144263-22D8-4571-B5CB-F6C1310552C6@merlinux.eu> References: <20160407102902.GE3558@uwanda> <7CD5DF0A-5D49-446B-8321-8666D60D875D@gmx.net> <4FDAE13D-4A94-440C-AC47-9E381806E0EA@gmx.net> <20160411091230.GB12415@uwanda> <20160411113701.GA25141@tonks> <3D2983A7-AE4B-44F8-8507-55613F30E09D@hackebrot.de> <7B144263-22D8-4571-B5CB-F6C1310552C6@merlinux.eu> Message-ID: On 12 Apr 2016, at 11:21, Holger Krekel wrote: > Hey Florian, all, > > is it possible that posts are sorted by the original posting date > (which is already displayed)? Can you point out where this isn't the case? I scrolled through all the current ones and they seem correct to me. > Is it possible to on your show the title and first Para of posts but > not the full text of each post on the default home page? (I'd prefer > that personally) I found no way to do that. Only some of the feeds contain a summary and I can't seem to access those from the template. The template language itself seems to be too restrictive to manipulate the content further. Regards, Florian Schulze From nicoddemus at gmail.com Tue Apr 12 15:30:01 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 12 Apr 2016 19:30:01 +0000 Subject: [pytest-dev] submitting nose2pytest for inclusion in pytest In-Reply-To: <20160411044151.GY25141@tonks> References: <20160411044151.GY25141@tonks> Message-ID: On Mon, Apr 11, 2016 at 1:42 AM Florian Bruhin wrote: > Hey Oliver, > > * oliver [2016-04-11 00:23:14 -0400]: > > I'd like to submit nose2pytest for inclusion in pytest, it is at > > https://github.com/schollii/nose2pytest. With v1.0.5 a pip install > installs > > a nose2pytest executable script that does the conversion, and a plugin > (via > > setuptools hook) so that some assert functions that can't be converted to > > raw assertions can still be used without needing nose to be installed on > > the system. > > I'm assuming you mean pytest-dev (the group on GitHub), not pytest > itself? > > In that case, +1 from me. > +1 from me as well. :) Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpfannsc at redhat.com Wed Apr 13 08:44:09 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Wed, 13 Apr 2016 14:44:09 +0200 Subject: [pytest-dev] removing assertion reinterpretation and making the assertion rewriter a vendored package Message-ID: Hi, currently we still have a monkey-patch in python that causes interesting issues in c interaction, namely the replacement of the Built-in Assertion error by the rewrite module its highly unlikely we can ever make it act correct, so i propose that instead we just remove the assertion re-interpreter while doing that i'd also like to turn the assertion rewriter into a package exposing a minimal api that way its releases can be done more in lock with python releases also its possible for others to use it and contribute to it -- Ronny -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.schulze at gmx.net Wed Apr 13 09:53:44 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Wed, 13 Apr 2016 15:53:44 +0200 Subject: [pytest-dev] removing assertion reinterpretation and making the assertion rewriter a vendored package In-Reply-To: References: Message-ID: <32A9AE79-5034-419D-A3FF-AD00229D55F9@gmx.net> > while doing that i'd also like to turn the assertion rewriter into a > package exposing a minimal api > that way its releases can be done more in lock with python releases > > also its possible for others to use it and contribute to it That would be great. I recently used it and it was kinda hard to figure out. Not sure I actually used the correct one in the end, but it worked for me at least. Regards, Florian Schulze From flub at devork.be Wed Apr 13 17:58:59 2016 From: flub at devork.be (Floris Bruynooghe) Date: Wed, 13 Apr 2016 22:58:59 +0100 Subject: [pytest-dev] removing assertion reinterpretation and making the assertion rewriter a vendored package In-Reply-To: References: Message-ID: Hello, On 13 April 2016 at 13:44, Ronny Pfannschmidt wrote: > currently we still have a monkey-patch in python that causes interesting > issues in c interaction, > > namely the replacement of the Built-in Assertion error by the rewrite module > > its highly unlikely we can ever make it act correct, so i propose that > instead we just remove the assertion re-interpreter This sounds good to me. We're currently not maintaining that code properly anyway and it has been 2nd class for a long time. My biggest worry is that occasionally we still say "disable rewrite" as a workaround, but there's still plain so that's probably ok. I assume dropping this is something for 3.0? > while doing that i'd also like to turn the assertion rewriter into a package > exposing a minimal api > that way its releases can be done more in lock with python releases > > also its possible for others to use it and contribute to it This I am less keen on. Most code in the re-write package is very py.test specific and often bugs about reporting involve code changes here. We're slowly moving things from py to pytest to avoid this pain so introducing it here seems counter-intuitive. I'm not sure which projects do want to use the assert replacing of py.test. Do you have a use-case in mind? Lastly, in the life of rewrite we've had just one case where the AST changed and we failed to keep up. I don't think this is such a heavy burden and our release process is ever getting better (thanks!) so should be less of an issue next time. Regards, Floris From nicoddemus at gmail.com Wed Apr 13 18:45:33 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 13 Apr 2016 22:45:33 +0000 Subject: [pytest-dev] submitting nose2pytest for inclusion in pytest In-Reply-To: References: <20160411044151.GY25141@tonks> Message-ID: On Wed, Apr 13, 2016 at 6:48 PM oliver wrote: > Thank you both, so based on the docs I can proceed to the next step (pull > request I think), let me know if I got this wrong. Cheers, > No problem! I created the teams on pytest-dev already, you should receive an invitation by email. After accepting it, please transfer the nose2pytest repository to pytest-dev and feel free to add other contributors to nose2pytest-admin and nose2pytest-developers teams as you see fit. Let us know if you have any problems! :) Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at viner.tv Wed Apr 13 19:02:22 2016 From: tom at viner.tv (Tom Viner) Date: Thu, 14 Apr 2016 00:02:22 +0100 Subject: [pytest-dev] removing assertion reinterpretation and making the assertion rewriter a vendored package Message-ID: > > > while doing that i'd also like to turn the assertion rewriter into a > > package exposing a minimal api > > that way its releases can be done more in lock with python releases > > > > also its possible for others to use it and contribute to it > Michael Foord (maintainer of unittest) wondered about this possibility when assertion rewriting was added 5 years ago: http://pybites.blogspot.co.uk/2011/07/behind-scenes-of-pytests-new-assertion.html?showComment=1310466554325#c8180305815700456332 -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Thu Apr 14 00:24:01 2016 From: me at the-compiler.org (Florian Bruhin) Date: Thu, 14 Apr 2016 06:24:01 +0200 Subject: [pytest-dev] removing assertion reinterpretation and making the assertion rewriter a vendored package In-Reply-To: References: Message-ID: <20160414042401.GP13282@tonks> * Floris Bruynooghe [2016-04-13 22:58:59 +0100]: > Hello, > > On 13 April 2016 at 13:44, Ronny Pfannschmidt wrote: > > currently we still have a monkey-patch in python that causes interesting > > issues in c interaction, > > > > namely the replacement of the Built-in Assertion error by the rewrite module > > > > its highly unlikely we can ever make it act correct, so i propose that > > instead we just remove the assertion re-interpreter > > This sounds good to me. We're currently not maintaining that code > properly anyway and it has been 2nd class for a long time. My biggest > worry is that occasionally we still say "disable rewrite" as a > workaround, but there's still plain so that's probably ok. > > I assume dropping this is something for 3.0? > > > while doing that i'd also like to turn the assertion rewriter into a package > > exposing a minimal api > > that way its releases can be done more in lock with python releases > > > > also its possible for others to use it and contribute to it > > This I am less keen on. Most code in the re-write package is very > py.test specific and often bugs about reporting involve code changes > here. We're slowly moving things from py to pytest to avoid this pain > so introducing it here seems counter-intuitive. > > I'm not sure which projects do want to use the assert replacing of > py.test. Do you have a use-case in mind? > > Lastly, in the life of rewrite we've had just one case where the AST > changed and we failed to keep up. I don't think this is such a heavy > burden and our release process is ever getting better (thanks!) so > should be less of an issue next time. I fully agree with Floris. Dropping reinterpret sounds like a good idea as I don't see any usecase for it anymore. And I also agree that splitting off assertion rewriting is probably more trouble than it's worth. Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I'm running a crowdfunding to work on my FOSS-project full-time: http://igg.me/at/qutebrowser -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From pghilardi at gmail.com Thu Apr 14 07:42:15 2016 From: pghilardi at gmail.com (Pedro Ghilardi) Date: Thu, 14 Apr 2016 08:42:15 -0300 Subject: [pytest-dev] ANN: atom-python-test released! Message-ID: Hey, I am working on a package to run py.test tests on Atom: Atom Python Test Currently it allows to run a test under cursor or all tests of a module. My idea is to evolve the plug-in to be able to format the tests output, re-run tests, run tests under specific regular expressions, etc. All feedback is appreciated! Thanks, Pedro -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpfannsc at redhat.com Thu Apr 14 07:52:18 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Thu, 14 Apr 2016 13:52:18 +0200 Subject: [pytest-dev] ANN: atom-python-test released! In-Reply-To: References: Message-ID: looks interesting, how does this interact with virtualenvs? im a atom user myself On Thu, Apr 14, 2016 at 1:42 PM, Pedro Ghilardi wrote: > Hey, > > I am working on a package to run py.test tests on Atom: Atom Python Test > > > Currently it allows to run a test under cursor or all tests of a module. > My idea is to evolve the plug-in to be able to format the tests output, > re-run tests, run tests under specific regular expressions, etc. > > All feedback is appreciated! > > Thanks, > Pedro > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpfannsc at redhat.com Thu Apr 14 08:35:34 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Thu, 14 Apr 2016 14:35:34 +0200 Subject: [pytest-dev] removing assertion reinterpretation and making the assertion rewriter a vendored package In-Reply-To: <20160414042401.GP13282@tonks> References: <20160414042401.GP13282@tonks> Message-ID: the only use-case reinterpret currently has, is fallback for when the import hook didnt trigger On Thu, Apr 14, 2016 at 6:24 AM, Florian Bruhin wrote: > * Floris Bruynooghe [2016-04-13 22:58:59 +0100]: > > Hello, > > > > On 13 April 2016 at 13:44, Ronny Pfannschmidt > wrote: > > > currently we still have a monkey-patch in python that causes > interesting > > > issues in c interaction, > > > > > > namely the replacement of the Built-in Assertion error by the rewrite > module > > > > > > its highly unlikely we can ever make it act correct, so i propose that > > > instead we just remove the assertion re-interpreter > > > > This sounds good to me. We're currently not maintaining that code > > properly anyway and it has been 2nd class for a long time. My biggest > > worry is that occasionally we still say "disable rewrite" as a > > workaround, but there's still plain so that's probably ok. > > > > I assume dropping this is something for 3.0? > > > > > while doing that i'd also like to turn the assertion rewriter into a > package > > > exposing a minimal api > > > that way its releases can be done more in lock with python releases > > > > > > also its possible for others to use it and contribute to it > > > > This I am less keen on. Most code in the re-write package is very > > py.test specific and often bugs about reporting involve code changes > > here. We're slowly moving things from py to pytest to avoid this pain > > so introducing it here seems counter-intuitive. > > > > I'm not sure which projects do want to use the assert replacing of > > py.test. Do you have a use-case in mind? > > > > Lastly, in the life of rewrite we've had just one case where the AST > > changed and we failed to keep up. I don't think this is such a heavy > > burden and our release process is ever getting better (thanks!) so > > should be less of an issue next time. > > I fully agree with Floris. Dropping reinterpret sounds like a good > idea as I don't see any usecase for it anymore. > > And I also agree that splitting off assertion rewriting is probably > more trouble than it's worth. > > Florian > > -- > http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) > GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc > I'm running a crowdfunding to work on my FOSS-project full-time: > http://igg.me/at/qutebrowser > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pghilardi at gmail.com Thu Apr 14 11:49:15 2016 From: pghilardi at gmail.com (Pedro Ghilardi) Date: Thu, 14 Apr 2016 12:49:15 -0300 Subject: [pytest-dev] ANN: atom-python-test released! In-Reply-To: References: Message-ID: Ronny, The editor will use the python environment that you were when you opened the editor. It does not exists a special handling to virtual envs. Thanks, Pedro On Thu, Apr 14, 2016 at 8:52 AM, Ronny Pfannschmidt wrote: > looks interesting, how does this interact with virtualenvs? > im a atom user myself > > On Thu, Apr 14, 2016 at 1:42 PM, Pedro Ghilardi > wrote: > >> Hey, >> >> I am working on a package to run py.test tests on Atom: Atom Python Test >> >> >> Currently it allows to run a test under cursor or all tests of a module. >> My idea is to evolve the plug-in to be able to format the tests output, >> re-run tests, run tests under specific regular expressions, etc. >> >> All feedback is appreciated! >> >> Thanks, >> Pedro >> >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shankarhiremath2006 at gmail.com Mon Apr 18 07:52:42 2016 From: shankarhiremath2006 at gmail.com (Shankar Hiremath) Date: Mon, 18 Apr 2016 17:22:42 +0530 Subject: [pytest-dev] pytest overall execution timeout option Message-ID: Hi All, Is there any any plugin similar to "pytest-timeout? but at higher level (ex: complete suite level execution timeout) My requirement is to run pytest with test suites and if all tests finishes well within the 2 hours time duration then its good, else I want to stop the test execution. ( I mean stop the current running test & further tests if any, but the pytest call backs should get executed, for example: pytest_sessionfinish need to be executed, before exiting pytest) Please suggest me if any existing plugins provides this feature, or any easy way to achieve this feature in pytest. Thanks -Shankar -------------- next part -------------- An HTML attachment was scrubbed... URL: From shankarhiremath2006 at gmail.com Mon Apr 18 07:56:09 2016 From: shankarhiremath2006 at gmail.com (Shankar Hiremath) Date: Mon, 18 Apr 2016 17:26:09 +0530 Subject: [pytest-dev] pytest overall execution timeout option Message-ID: Hi All, Is there any any plugin similar to "pytest-timeout? but at higher level (ex: complete suite level execution timeout) My requirement is to run pytest with test suites and if all tests finishes well within the 2 hours time duration then its good, else I want to stop the test execution. ( I mean stop the current running test & further tests if any, but the pytest call backs should get executed, for example: pytest_sessionfinish need to be executed, before exiting pytest) Please suggest me if any existing plugins provides this feature, or any easy way to achieve this feature in pytest. Thanks -Shankar -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Mon Apr 18 09:26:46 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Mon, 18 Apr 2016 13:26:46 +0000 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: Message-ID: Hi Shankar, I don?t know of any plugin that does this out of the box, but the simplest way I found is to implement this is using an auto-use fixture: # contents of conftest.pyimport pytestimport time def pytest_sessionstart(session): session.start_time = time.time() @pytest.fixture(autouse=True)def check_session_time(request): elapsed = time.time() - request.session.start_time if elapsed > 1.0: request.session.shouldstop = 'time limit reached: %0.2f seconds' % elapsed # contents of test_foo.pyimport pytestimport time @pytest.mark.parametrize('i', range(10))def test_foo(i): time.sleep(0.5) Running this produces: collected 10 items test_foo.py ... !!!!!!!!!!!!!!!! Interrupted: time limit reached: 1.11 seconds !!!!!!!!!!!!!!!! ========================== 3 passed in 1.69 seconds =========================== Hope that helps. Cheers, Bruno. ? On Mon, Apr 18, 2016 at 8:56 AM Shankar Hiremath < shankarhiremath2006 at gmail.com> wrote: > Hi All, > > Is there any any plugin similar to "pytest-timeout? but at higher level > (ex: complete suite level execution timeout) > > My requirement is to run pytest with test suites and if all tests finishes > well within the 2 hours time duration then its good, else I want to stop > the test execution. > ( I mean stop the current running test & further tests if any, but the > pytest call backs should get executed, for example: pytest_sessionfinish > need to be executed, before exiting pytest) > > Please suggest me if any existing plugins provides this feature, or any > easy way to achieve this feature in pytest. > > Thanks > -Shankar > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From edisongustavo at gmail.com Mon Apr 18 09:41:28 2016 From: edisongustavo at gmail.com (Edison Gustavo Muenz) Date: Mon, 18 Apr 2016 10:41:28 -0300 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: Message-ID: Why is the fixture only called at the end? Is this guaranteed behaviour from pytest? On Mon, Apr 18, 2016 at 10:26 AM, Bruno Oliveira wrote: > Hi Shankar, > > I don?t know of any plugin that does this out of the box, but the simplest > way I found is to implement this is using an auto-use fixture: > > # contents of conftest.pyimport pytestimport time > def pytest_sessionstart(session): > session.start_time = time.time() > @pytest.fixture(autouse=True)def check_session_time(request): > elapsed = time.time() - request.session.start_time > if elapsed > 1.0: > request.session.shouldstop = 'time limit reached: %0.2f seconds' % elapsed > # contents of test_foo.pyimport pytestimport time > @pytest.mark.parametrize('i', range(10))def test_foo(i): > time.sleep(0.5) > > Running this produces: > > collected 10 items > > test_foo.py ... > > !!!!!!!!!!!!!!!! Interrupted: time limit reached: 1.11 seconds !!!!!!!!!!!!!!!! > ========================== 3 passed in 1.69 seconds =========================== > > Hope that helps. > > Cheers, > Bruno. > ? > > On Mon, Apr 18, 2016 at 8:56 AM Shankar Hiremath < > shankarhiremath2006 at gmail.com> wrote: > >> Hi All, >> >> Is there any any plugin similar to "pytest-timeout? but at higher level >> (ex: complete suite level execution timeout) >> >> My requirement is to run pytest with test suites and if all tests >> finishes well within the 2 hours time duration then its good, else I want >> to stop the test execution. >> ( I mean stop the current running test & further tests if any, but the >> pytest call backs should get executed, for example: pytest_sessionfinish >> need to be executed, before exiting pytest) >> >> Please suggest me if any existing plugins provides this feature, or any >> easy way to achieve this feature in pytest. >> >> Thanks >> -Shankar >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev >> > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Mon Apr 18 09:54:45 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Mon, 18 Apr 2016 13:54:45 +0000 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: <5714E58B.1050009@ronnypfannschmidt.de> References: <5714E58B.1050009@ronnypfannschmidt.de> Message-ID: On Mon, Apr 18, 2016 at 10:47 AM Ronny Pfannschmidt < ich at ronnypfannschmidt.de> wrote: > the given simple implementation is called at the setup of a test item and > has effect after teardown of that test item > > (note how py.test took 1.69 seconds, even tho the timeout is 1 second and > each test takes 0.5 seconds) > > the reason for that difference is that the exit condition is set at the > setup of the test that will take 0.5 seconds, and then is checked after the > teardown of that test in the py.test testloop > > to get more exact the check has to be done at test teardown, > > to get even more exact, you need to use tools similar to pytest-timeout > and calculate exact maximum remaining run times in a fixture > > it would be helpful if you outlined your use-case a bit more exactly > instead of the envisioned implementation as "global timeout" > Ronny is correct if one wants more control exactly when to stop. >From the brief description provided by Shankar I assumed a "soft timeout" was what he wanted, which is why I went for the simpler implementation which achieves that. Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aninhacostaribeiro at gmail.com Mon Apr 18 15:28:29 2016 From: aninhacostaribeiro at gmail.com (Ana Ribeiro) Date: Mon, 18 Apr 2016 16:28:29 -0300 Subject: [pytest-dev] Participation in Pytest sprint Message-ID: Hello! My name is Ana and I am an almost 20 years old girl from Brazil (my birthday is on may) and this year I am going to work with Pytest this summer in an internship program named "Outreachy" ( https://github.com/davehunt/pytest-html#outreachy). I am going to London to participate in "All Hands" Mozilla meeting and my mentor (Dave Hunt) said that after this week he is going to Germany to participate in this sprint ( http://pytest.org/latest/announce/sprint2016.html), and we think that is a great idea if I go as well since I will have the chance to meet so many expert people and get help of you all on the development of my project. The funding I need is to cover my travel expenses from London to Freiburg (I looked for some flights and trains and I think it is about 200?) and a place to stay (I would love to stay with everyone in the same house/flat) and maybe money for some food or some food. Regards, Ana -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.hirschfeld at gmail.com Mon Apr 18 19:45:06 2016 From: dave.hirschfeld at gmail.com (Dave) Date: Mon, 18 Apr 2016 23:45:06 +0000 (UTC) Subject: [pytest-dev] Test discovery by subclassing Message-ID: Hi, Instead of discovering tests by name matching is there any way to specify that all subclasses of X be collected? I realise this can be done by subclassing unittest.TestCase but that is a) pretty heavyweight and b) seems to break parameterised fixtures for me. Thanks, Dave From nicoddemus at gmail.com Tue Apr 19 07:22:31 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 19 Apr 2016 11:22:31 +0000 Subject: [pytest-dev] Test discovery by subclassing In-Reply-To: References: Message-ID: Hi Dave, Using plain pytest that is currently not possible, and I?m not aware of any plugin which allows this. You can implement your own collection rules by implementing the pytest_pycollect_makeitem hook. I suggest taking a look at how pytest itself does it to get some guidance, but I think this would be enough for your case: # conftest.pyimport inspect class X: pass def pytest_pycollect_makeitem(collector, name, obj): if inspect.isclass(obj) and issubclass(obj, X): Class = collector._getcustomclass("Class") return Class(name, parent=collector) # test_foo.pyfrom conftest import X class Foo(X): def test_foo(self): pass test_foo.py::Foo::test_foo PASSED ========================== 1 passed in 0.13 seconds =========================== Cheers, Bruno. ? On Tue, Apr 19, 2016 at 7:46 AM Dave wrote: > Hi, > Instead of discovering tests by name matching is there any way to specify > that all subclasses of X be collected? > > I realise this can be done by subclassing unittest.TestCase but that is a) > pretty heavyweight and b) seems to break parameterised fixtures for me. > > > Thanks, > Dave > > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpfannsc at redhat.com Tue Apr 19 07:34:34 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Tue, 19 Apr 2016 13:34:34 +0200 Subject: [pytest-dev] Test discovery by subclassing In-Reply-To: References: Message-ID: my understanding is, that the pytest_pycollect_makeitem hook is the official way to do something like that in plain pytest as part of a conftest or a local plugin On Tue, Apr 19, 2016 at 1:22 PM, Bruno Oliveira wrote: > Hi Dave, > > Using plain pytest that is currently not possible, and I?m not aware of > any plugin which allows this. > > You can implement your own collection rules by implementing the > pytest_pycollect_makeitem > > hook. I suggest taking a look at how pytest itself does it > > to get some guidance, but I think this would be enough for your case: > > # conftest.pyimport inspect > class X: pass > def pytest_pycollect_makeitem(collector, name, obj): > if inspect.isclass(obj) and issubclass(obj, X): > Class = collector._getcustomclass("Class") > return Class(name, parent=collector) > # test_foo.pyfrom conftest import X > class Foo(X): > def test_foo(self): > pass > > test_foo.py::Foo::test_foo PASSED > > ========================== 1 passed in 0.13 seconds =========================== > > Cheers, > Bruno. > ? > > On Tue, Apr 19, 2016 at 7:46 AM Dave wrote: > >> Hi, >> Instead of discovering tests by name matching is there any way to specify >> that all subclasses of X be collected? >> >> I realise this can be done by subclassing unittest.TestCase but that is a) >> pretty heavyweight and b) seems to break parameterised fixtures for me. >> >> >> Thanks, >> Dave >> >> >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev >> > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Tue Apr 19 07:46:03 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 19 Apr 2016 11:46:03 +0000 Subject: [pytest-dev] Test discovery by subclassing In-Reply-To: References: Message-ID: On Tue, Apr 19, 2016 at 8:34 AM Ronny Pfannschmidt wrote: > my understanding is, that the pytest_pycollect_makeitem > > hook is the official way to do something like that in plain pytest as part > of a conftest or a local plugin > Sorry, I meant "out of the box". :) Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shankarhiremath2006 at gmail.com Wed Apr 20 08:07:42 2016 From: shankarhiremath2006 at gmail.com (Shankar Hiremath) Date: Wed, 20 Apr 2016 17:37:42 +0530 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: Message-ID: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> Hi Bruno, I tried with the below approach provided by you, when i increase the sleep time inside the test_foo to 10 sec, then the test execution took 20.12 sec and then after further test case execution stooped. but what i required is to stop the test itself instead of waiting for the test to complete (in this case 10 sec sleep), i agree for this case pytest-timeout is the best option. My use case is little bit different: whenever there is a new commit, i am going to run smoke tests which are annotated with ?pytest.mark.smoke? annotation in pytest (around 400 test cases) when the new commit code quality is of good then all of the smoke tests will get completed well within 2 hours duration, when there is a product issue due to new commit randomly few of the tests might get hanged for some time due to that, the overall test execution will take > 2hours. 1) if all tests passed well within 2 hour duration i will say ?+1? to the commit, 2) if any test failed & all are well within 2 hour duration all tests completed i will say ?-1? to the commit, 3) if tests are taking more time >2 hours or any test hanged, i want to stop the current running test & stop further test execution, i will say ?-1? to the commit, Inorder to achieve the case-3, i need to have some mechanism of global timeout of 2 hours (i am ok with +/- 5 minutes difference accuracy) from pytest execution. Any suggestion or approach to achieve this will very helpful. Thanks in advance. def pytest_sessionstart(session): session.start_time = time.time() @pytest.fixture(autouse=True) def check_session_time(request): elapsed = time.time() - request.session.start_time if elapsed > 1.0: request.session.shouldstop = 'time limit reached: %0.2f seconds' % elapsed @pytest.mark.parametrize('i', range(10)) def test_foo(i): time.sleep(10) The output of pytest execution is as below: ================================================= test session starts ================================================= platform linux2 -- Python 2.7.6 -- py-1.4.31 -- pytest-2.6.2 plugins: timeout collected 10 items a.py .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: time limit reached: 10.02 seconds !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================================== 2 passed in 20.12 seconds ============================================= Thanks -Shankar On Apr 19, 2016, at 9:22 PM, Shankar Hiremath wrote: > Hi Bruno, > > Thanks a lot, this meets my requirement. I will go ahead with the approach provided by you. > > Regards > -Shankar > > On Mon, Apr 18, 2016 at 6:56 PM, Bruno Oliveira wrote: > Hi Shankar, > > I don?t know of any plugin that does this out of the box, but the simplest way I found is to implement this is using an auto-use fixture: > > # contents of conftest.py > import pytest > import time > > def pytest_sessionstart(session): > session.start_time = time.time() > > @pytest.fixture(autouse=True) > def check_session_time(request): > elapsed = time.time() - request.session.start_time > if elapsed > 1.0: > request.session.shouldstop = 'time limit reached: %0.2f seconds' % elapsed > > # contents of test_foo.py > import pytest > import time > > @pytest.mark.parametrize('i', range(10)) > def test_foo(i): > time.sleep(0.5) > Running this produces: > > collected 10 items > > test_foo.py ... > > !!!!!!!!!!!!!!!! Interrupted: time limit reached: 1.11 seconds !!!!!!!!!!!!!!!! > ========================== 3 passed in 1.69 seconds =========================== > Hope that helps. > > Cheers, > Bruno. > > > On Mon, Apr 18, 2016 at 8:56 AM Shankar Hiremath wrote: > Hi All, > > Is there any any plugin similar to "pytest-timeout? but at higher level (ex: complete suite level execution timeout) > > My requirement is to run pytest with test suites and if all tests finishes well within the 2 hours time duration then its good, else I want to stop the test execution. > ( I mean stop the current running test & further tests if any, but the pytest call backs should get executed, for example: pytest_sessionfinish need to be executed, before exiting pytest) > > Please suggest me if any existing plugins provides this feature, or any easy way to achieve this feature in pytest. > > Thanks > -Shankar > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.hirschfeld at gmail.com Tue Apr 19 20:19:40 2016 From: dave.hirschfeld at gmail.com (Dave) Date: Wed, 20 Apr 2016 00:19:40 +0000 (UTC) Subject: [pytest-dev] Test discovery by subclassing References: Message-ID: Bruno Oliveira writes: > > > > Hi Dave, > Using plain pytest that is currently not possible, and I?m not aware of any plugin which allows this. > You can implement your own collection rules by implementing the pytest_pycollect_makeitem hook. I suggest taking a look at how pytest itself does it to get some guidance, but I think this would be enough for your case: > # conftest.py > import inspect > > class X: pass > > def pytest_pycollect_makeitem(collector, name, obj): > if inspect.isclass(obj) and issubclass(obj, X): > Class = collector._getcustomclass("Class") > return Class(name, parent=collector) > > # test_foo.py > from conftest import X > > class Foo(X): > def test_foo(self): > pass > > test_foo.py::Foo::test_foo PASSED > > ========================== 1 passed in 0.13 seconds =========================== > Cheers,Bruno. Cheers for the detailed answer! I'll give it a go as I think it's a nicer way to explicitly mark classes for testing. Thanks, Dave From flub at devork.be Wed Apr 20 09:12:53 2016 From: flub at devork.be (Floris Bruynooghe) Date: Wed, 20 Apr 2016 14:12:53 +0100 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> Message-ID: If you need actual interruption then as said you need to use the mechanisms that pytest-timeout uses. But bear in mind that they come with lots of caveats about how they work. Short of an external process supervisor which does `kill -9` nothing is ever guaranteed to stop your test run. But depending on what sort of things do pytest-timeout could be perfectly fine. I'd be perfectly fine with adding a `--global-timeout` option to pytest-timeout if you would like to submit a pull request. That's probably easier then starting to re-implement that interrupting behaviour from scratch. Regards, Floris On 20 April 2016 at 13:07, Shankar Hiremath wrote: > Hi Bruno, > > I tried with the below approach provided by you, when i increase the sleep > time inside the test_foo to 10 sec, then the test execution took 20.12 sec > and then after further test case execution stooped. > > but what i required is to stop the test itself instead of waiting for the > test to complete (in this case 10 sec sleep), i agree for this case > pytest-timeout is the best option. > > My use case is little bit different: whenever there is a new commit, i am > going to run smoke tests which are annotated with ?pytest.mark.smoke? > annotation in pytest (around 400 test cases) > when the new commit code quality is of good then all of the smoke tests will > get completed well within 2 hours duration, when there is a product issue > due to new commit randomly few of the tests might get hanged for some time > due to that, the overall test execution will take > 2hours. > > 1) if all tests passed well within 2 hour duration i will say ?+1? to the > commit, > 2) if any test failed & all are well within 2 hour duration all tests > completed i will say ?-1? to the commit, > 3) if tests are taking more time >2 hours or any test hanged, i want to stop > the current running test & stop further test execution, i will say ?-1? to > the commit, > > Inorder to achieve the case-3, i need to have some mechanism of global > timeout of 2 hours (i am ok with +/- 5 minutes difference accuracy) from > pytest execution. > Any suggestion or approach to achieve this will very helpful. Thanks in > advance. > > def pytest_sessionstart(session): > session.start_time = time.time() > > @pytest.fixture(autouse=True) > def check_session_time(request): > elapsed = time.time() - request.session.start_time > if elapsed > 1.0: > request.session.shouldstop = 'time limit reached: %0.2f seconds' % > elapsed > > @pytest.mark.parametrize('i', range(10)) > def test_foo(i): > time.sleep(10) > > > The output of pytest execution is as below: > > ================================================= test session starts > ================================================= > platform linux2 -- Python 2.7.6 -- py-1.4.31 -- pytest-2.6.2 > plugins: timeout > collected 10 items > > a.py .. > > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: time limit reached: 10.02 > seconds !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! > ============================================== 2 passed in 20.12 seconds > ============================================= > > > Thanks > -Shankar > > > On Apr 19, 2016, at 9:22 PM, Shankar Hiremath > wrote: > > Hi Bruno, > > Thanks a lot, this meets my requirement. I will go ahead with the approach > provided by you. > > Regards > -Shankar > > On Mon, Apr 18, 2016 at 6:56 PM, Bruno Oliveira > wrote: >> >> Hi Shankar, >> >> I don?t know of any plugin that does this out of the box, but the simplest >> way I found is to implement this is using an auto-use fixture: >> >> # contents of conftest.py >> import pytest >> import time >> >> def pytest_sessionstart(session): >> session.start_time = time.time() >> >> @pytest.fixture(autouse=True) >> def check_session_time(request): >> elapsed = time.time() - request.session.start_time >> if elapsed > 1.0: >> request.session.shouldstop = 'time limit reached: %0.2f seconds' % >> elapsed >> >> # contents of test_foo.py >> import pytest >> import time >> >> @pytest.mark.parametrize('i', range(10)) >> def test_foo(i): >> time.sleep(0.5) >> >> Running this produces: >> >> collected 10 items >> >> test_foo.py ... >> >> !!!!!!!!!!!!!!!! Interrupted: time limit reached: 1.11 seconds >> !!!!!!!!!!!!!!!! >> ========================== 3 passed in 1.69 seconds >> =========================== >> >> Hope that helps. >> >> Cheers, >> Bruno. >> >> >> On Mon, Apr 18, 2016 at 8:56 AM Shankar Hiremath >> wrote: >>> >>> Hi All, >>> >>> Is there any any plugin similar to "pytest-timeout? but at higher level >>> (ex: complete suite level execution timeout) >>> >>> My requirement is to run pytest with test suites and if all tests >>> finishes well within the 2 hours time duration then its good, else I want to >>> stop the test execution. >>> ( I mean stop the current running test & further tests if any, but the >>> pytest call backs should get executed, for example: pytest_sessionfinish >>> need to be executed, before exiting pytest) >>> >>> Please suggest me if any existing plugins provides this feature, or any >>> easy way to achieve this feature in pytest. >>> >>> Thanks >>> -Shankar >>> _______________________________________________ >>> pytest-dev mailing list >>> pytest-dev at python.org >>> https://mail.python.org/mailman/listinfo/pytest-dev > > > > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > From nicoddemus at gmail.com Wed Apr 20 09:42:49 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 20 Apr 2016 13:42:49 +0000 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> Message-ID: On Wed, Apr 20, 2016 at 10:38 AM Obermann, Stephan < stephan.obermann at dolby.com> wrote: > Just a thought, but if you want to kill the whole test run after 2h no > matter what the actual test results are - why not simply set a timeout in > your test automation system (the one that calls py.test). Most systems > (Jenkins, Electric Commander, etc.) provide this feature and it would spare > you from implementing your custom workflow logic on the "test runner" level. > I second that, that's what we have in place here at work. Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephan.obermann at dolby.com Wed Apr 20 09:37:59 2016 From: stephan.obermann at dolby.com (Obermann, Stephan) Date: Wed, 20 Apr 2016 13:37:59 +0000 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> References: , <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> Message-ID: <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> Just a thought, but if you want to kill the whole test run after 2h no matter what the actual test results are - why not simply set a timeout in your test automation system (the one that calls py.test). Most systems (Jenkins, Electric Commander, etc.) provide this feature and it would spare you from implementing your custom workflow logic on the "test runner" level. Cheers, /stephan On 20 Apr 2016, at 14:08, Shankar Hiremath > wrote: Hi Bruno, I tried with the below approach provided by you, when i increase the sleep time inside the test_foo to 10 sec, then the test execution took 20.12 sec and then after further test case execution stooped. but what i required is to stop the test itself instead of waiting for the test to complete (in this case 10 sec sleep), i agree for this case pytest-timeout is the best option. My use case is little bit different: whenever there is a new commit, i am going to run smoke tests which are annotated with ?pytest.mark.smoke? annotation in pytest (around 400 test cases) when the new commit code quality is of good then all of the smoke tests will get completed well within 2 hours duration, when there is a product issue due to new commit randomly few of the tests might get hanged for some time due to that, the overall test execution will take > 2hours. 1) if all tests passed well within 2 hour duration i will say ?+1? to the commit, 2) if any test failed & all are well within 2 hour duration all tests completed i will say ?-1? to the commit, 3) if tests are taking more time >2 hours or any test hanged, i want to stop the current running test & stop further test execution, i will say ?-1? to the commit, Inorder to achieve the case-3, i need to have some mechanism of global timeout of 2 hours (i am ok with +/- 5 minutes difference accuracy) from pytest execution. Any suggestion or approach to achieve this will very helpful. Thanks in advance. def pytest_sessionstart(session): session.start_time = time.time() @pytest.fixture(autouse=True) def check_session_time(request): elapsed = time.time() - request.session.start_time if elapsed > 1.0: request.session.shouldstop = 'time limit reached: %0.2f seconds' % elapsed @pytest.mark.parametrize('i', range(10)) def test_foo(i): time.sleep(10) The output of pytest execution is as below: ================================================= test session starts ================================================= platform linux2 -- Python 2.7.6 -- py-1.4.31 -- pytest-2.6.2 plugins: timeout collected 10 items a.py .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: time limit reached: 10.02 seconds !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================================== 2 passed in 20.12 seconds ============================================= Thanks -Shankar On Apr 19, 2016, at 9:22 PM, Shankar Hiremath > wrote: Hi Bruno, Thanks a lot, this meets my requirement. I will go ahead with the approach provided by you. Regards -Shankar On Mon, Apr 18, 2016 at 6:56 PM, Bruno Oliveira > wrote: Hi Shankar, I don?t know of any plugin that does this out of the box, but the simplest way I found is to implement this is using an auto-use fixture: # contents of conftest.py import pytest import time def pytest_sessionstart(session): session.start_time = time.time() @pytest.fixture(autouse=True) def check_session_time(request): elapsed = time.time() - request.session.start_time if elapsed > 1.0: request.session.shouldstop = 'time limit reached: %0.2f seconds' % elapsed # contents of test_foo.py import pytest import time @pytest.mark.parametrize('i', range(10)) def test_foo(i): time.sleep(0.5) Running this produces: collected 10 items test_foo.py ... !!!!!!!!!!!!!!!! Interrupted: time limit reached: 1.11 seconds !!!!!!!!!!!!!!!! ========================== 3 passed in 1.69 seconds =========================== Hope that helps. Cheers, Bruno. ? On Mon, Apr 18, 2016 at 8:56 AM Shankar Hiremath > wrote: Hi All, Is there any any plugin similar to "pytest-timeout? but at higher level (ex: complete suite level execution timeout) My requirement is to run pytest with test suites and if all tests finishes well within the 2 hours time duration then its good, else I want to stop the test execution. ( I mean stop the current running test & further tests if any, but the pytest call backs should get executed, for example: pytest_sessionfinish need to be executed, before exiting pytest) Please suggest me if any existing plugins provides this feature, or any easy way to achieve this feature in pytest. Thanks -Shankar _______________________________________________ pytest-dev mailing list pytest-dev at python.org https://mail.python.org/mailman/listinfo/pytest-dev _______________________________________________ pytest-dev mailing list pytest-dev at python.org https://mail.python.org/mailman/listinfo/pytest-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From shankarhiremath2006 at gmail.com Wed Apr 20 10:01:05 2016 From: shankarhiremath2006 at gmail.com (Shankar Hiremath) Date: Wed, 20 Apr 2016 19:31:05 +0530 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> Message-ID: Hi Bruno / Obermann, As part of ?pytest_sessionfinish? we are doing few major activities (collecting cluster logs, artifacts, screen shots & videos of testing and moving to central location), so if kill the pytest based on global timeout then i will lose all the important data which is required for analyzing. if you have any other suggestions to hanldle global timeout for pytest, it will be great. Thanks -Shankar On Apr 20, 2016, at 7:12 PM, Bruno Oliveira wrote: > > > On Wed, Apr 20, 2016 at 10:38 AM Obermann, Stephan wrote: > Just a thought, but if you want to kill the whole test run after 2h no matter what the actual test results are - why not simply set a timeout in your test automation system (the one that calls py.test). Most systems (Jenkins, Electric Commander, etc.) provide this feature and it would spare you from implementing your custom workflow logic on the "test runner" level. > > I second that, that's what we have in place here at work. > > Cheers, > Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shankarhiremath2006 at gmail.com Wed Apr 20 10:07:25 2016 From: shankarhiremath2006 at gmail.com (Shankar Hiremath) Date: Wed, 20 Apr 2016 19:37:25 +0530 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> Message-ID: <08D2B352-3BE6-4142-BF95-140C25ECC601@gmail.com> Hi Floris, Thank you for the suggestion, can you please give me few pointers or guidenace to start with (i am relatively new to pytest plugin development) i will try to implement and send the pull request. Thanks -Shankar On Apr 20, 2016, at 6:42 PM, Floris Bruynooghe wrote: > If you need actual interruption then as said you need to use the > mechanisms that pytest-timeout uses. But bear in mind that they come > with lots of caveats about how they work. Short of an external > process supervisor which does `kill -9` nothing is ever guaranteed to > stop your test run. But depending on what sort of things do > pytest-timeout could be perfectly fine. > > I'd be perfectly fine with adding a `--global-timeout` option to > pytest-timeout if you would like to submit a pull request. That's > probably easier then starting to re-implement that interrupting > behaviour from scratch. > > Regards, > Floris > > > > On 20 April 2016 at 13:07, Shankar Hiremath > wrote: >> Hi Bruno, >> >> I tried with the below approach provided by you, when i increase the sleep >> time inside the test_foo to 10 sec, then the test execution took 20.12 sec >> and then after further test case execution stooped. >> >> but what i required is to stop the test itself instead of waiting for the >> test to complete (in this case 10 sec sleep), i agree for this case >> pytest-timeout is the best option. >> >> My use case is little bit different: whenever there is a new commit, i am >> going to run smoke tests which are annotated with ?pytest.mark.smoke? >> annotation in pytest (around 400 test cases) >> when the new commit code quality is of good then all of the smoke tests will >> get completed well within 2 hours duration, when there is a product issue >> due to new commit randomly few of the tests might get hanged for some time >> due to that, the overall test execution will take > 2hours. >> >> 1) if all tests passed well within 2 hour duration i will say ?+1? to the >> commit, >> 2) if any test failed & all are well within 2 hour duration all tests >> completed i will say ?-1? to the commit, >> 3) if tests are taking more time >2 hours or any test hanged, i want to stop >> the current running test & stop further test execution, i will say ?-1? to >> the commit, >> >> Inorder to achieve the case-3, i need to have some mechanism of global >> timeout of 2 hours (i am ok with +/- 5 minutes difference accuracy) from >> pytest execution. >> Any suggestion or approach to achieve this will very helpful. Thanks in >> advance. >> >> def pytest_sessionstart(session): >> session.start_time = time.time() >> >> @pytest.fixture(autouse=True) >> def check_session_time(request): >> elapsed = time.time() - request.session.start_time >> if elapsed > 1.0: >> request.session.shouldstop = 'time limit reached: %0.2f seconds' % >> elapsed >> >> @pytest.mark.parametrize('i', range(10)) >> def test_foo(i): >> time.sleep(10) >> >> >> The output of pytest execution is as below: >> >> ================================================= test session starts >> ================================================= >> platform linux2 -- Python 2.7.6 -- py-1.4.31 -- pytest-2.6.2 >> plugins: timeout >> collected 10 items >> >> a.py .. >> >> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: time limit reached: 10.02 >> seconds !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! >> ============================================== 2 passed in 20.12 seconds >> ============================================= >> >> >> Thanks >> -Shankar >> >> >> On Apr 19, 2016, at 9:22 PM, Shankar Hiremath >> wrote: >> >> Hi Bruno, >> >> Thanks a lot, this meets my requirement. I will go ahead with the approach >> provided by you. >> >> Regards >> -Shankar >> >> On Mon, Apr 18, 2016 at 6:56 PM, Bruno Oliveira >> wrote: >>> >>> Hi Shankar, >>> >>> I don?t know of any plugin that does this out of the box, but the simplest >>> way I found is to implement this is using an auto-use fixture: >>> >>> # contents of conftest.py >>> import pytest >>> import time >>> >>> def pytest_sessionstart(session): >>> session.start_time = time.time() >>> >>> @pytest.fixture(autouse=True) >>> def check_session_time(request): >>> elapsed = time.time() - request.session.start_time >>> if elapsed > 1.0: >>> request.session.shouldstop = 'time limit reached: %0.2f seconds' % >>> elapsed >>> >>> # contents of test_foo.py >>> import pytest >>> import time >>> >>> @pytest.mark.parametrize('i', range(10)) >>> def test_foo(i): >>> time.sleep(0.5) >>> >>> Running this produces: >>> >>> collected 10 items >>> >>> test_foo.py ... >>> >>> !!!!!!!!!!!!!!!! Interrupted: time limit reached: 1.11 seconds >>> !!!!!!!!!!!!!!!! >>> ========================== 3 passed in 1.69 seconds >>> =========================== >>> >>> Hope that helps. >>> >>> Cheers, >>> Bruno. >>> >>> >>> On Mon, Apr 18, 2016 at 8:56 AM Shankar Hiremath >>> wrote: >>>> >>>> Hi All, >>>> >>>> Is there any any plugin similar to "pytest-timeout? but at higher level >>>> (ex: complete suite level execution timeout) >>>> >>>> My requirement is to run pytest with test suites and if all tests >>>> finishes well within the 2 hours time duration then its good, else I want to >>>> stop the test execution. >>>> ( I mean stop the current running test & further tests if any, but the >>>> pytest call backs should get executed, for example: pytest_sessionfinish >>>> need to be executed, before exiting pytest) >>>> >>>> Please suggest me if any existing plugins provides this feature, or any >>>> easy way to achieve this feature in pytest. >>>> >>>> Thanks >>>> -Shankar >>>> _______________________________________________ >>>> pytest-dev mailing list >>>> pytest-dev at python.org >>>> https://mail.python.org/mailman/listinfo/pytest-dev >> >> >> >> >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev >> From nicoddemus at gmail.com Wed Apr 20 12:04:44 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 20 Apr 2016 16:04:44 +0000 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> Message-ID: On Wed, Apr 20, 2016 at 11:01 AM Shankar Hiremath < shankarhiremath2006 at gmail.com> wrote: > As part of ?pytest_sessionfinish? we are doing few major activities > (collecting cluster logs, artifacts, screen shots & videos of testing and > moving to central location), > so if kill the pytest based on global timeout then i will lose all the > important data which is required for analyzing. > Oh right, forgot you mentioned that. Currently pytest-timeout kills the process when a test times out, I guess it would be possible to change it to call an optional custom function that you can use to do your cleanup routines before it effectively kills the process. import pytest_timeoutfrom mylib import collect_artifacts_videos_and_move_them pytest_timeout.before_process_kill = collect_artifacts_videos_and_move_them def pytest_sessionfinish(): collect_artifacts_videos_and_move_them() Your clean up routines would have to be resilient enough to be called even if a test has not finished yet, however. Another option is to do something similar to what is done in pytest-timeout in terms of stopping test execution, but instead of killing the process you have to set some kind of flag/file/whatever which is monitored by the code under execution. When that flag/file is set, your code will have to explicitly bail out of whatever it is doing, and then the pytest test session would finish normally. One way to stop the section is to set the ?shouldstop? attribute as I demonstrated earlier. Hope that helps, Bruno. ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From flub at devork.be Wed Apr 20 12:30:30 2016 From: flub at devork.be (Floris Bruynooghe) Date: Wed, 20 Apr 2016 17:30:30 +0100 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> Message-ID: On 20 April 2016 at 17:04, Bruno Oliveira wrote: > On Wed, Apr 20, 2016 at 11:01 AM Shankar Hiremath > wrote: >> >> As part of ?pytest_sessionfinish? we are doing few major activities >> (collecting cluster logs, artifacts, screen shots & videos of testing and >> moving to central location), >> so if kill the pytest based on global timeout then i will lose all the >> important data which is required for analyzing. > > > Oh right, forgot you mentioned that. > > Currently pytest-timeout kills the process when a test times out, With the signal method (default if you're on unix) it raises an pytest.fail.Exception from inside the signal handler, which means it gets raised from inside the test function call, the test fails and then finalizers run just normal. However not all code can be interrupted this way, works most of the time though. From flub at devork.be Wed Apr 20 12:34:08 2016 From: flub at devork.be (Floris Bruynooghe) Date: Wed, 20 Apr 2016 17:34:08 +0100 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: <08D2B352-3BE6-4142-BF95-140C25ECC601@gmail.com> References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> <08D2B352-3BE6-4142-BF95-140C25ECC601@gmail.com> Message-ID: On 20 April 2016 at 15:07, Shankar Hiremath wrote: > Hi Floris, > > Thank you for the suggestion, can you please give me few pointers or guidenace to start with (i am relatively new to pytest plugin development) > i will try to implement and send the pull request. First it should be added to pytest_addoption and pytest_configure, then new hooks for pytest_sessionstart and pytest_sessionfinish would need to be added to do something similar to what timeout_setup does now. There are some edge cases to thing about, like how to deal with both global and the current timeouts etc. From nicoddemus at gmail.com Wed Apr 20 12:44:37 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 20 Apr 2016 16:44:37 +0000 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> Message-ID: On Wed, Apr 20, 2016 at 1:30 PM Floris Bruynooghe wrote: > With the signal method (default if you're on unix) it raises an > pytest.fail.Exception from inside the signal handler, which means it > gets raised from inside the test function call, the test fails and > then finalizers run just normal. However not all code can be > interrupted this way, works most of the time though. > Oh right, thanks for the correction! :) Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shankarhiremath2006 at gmail.com Wed Apr 20 13:05:12 2016 From: shankarhiremath2006 at gmail.com (Shankar Hiremath) Date: Wed, 20 Apr 2016 22:35:12 +0530 Subject: [pytest-dev] pytest overall execution timeout option In-Reply-To: References: <8B5656EC-5CE3-48FF-AF55-DF2D3A08325C@gmail.com> <44D5365D-29C8-4232-A000-CC59616905C9@dolby.com> Message-ID: Hi Bruno, Thanks for the suggestion for ?pytest_timeout.before_process_kill? but the pytest_timeout works at test case level, what i require is a global timeout for pytest (not at test case level timeout) Thanks -Shankar On Apr 20, 2016, at 9:34 PM, Bruno Oliveira wrote: > On Wed, Apr 20, 2016 at 11:01 AM Shankar Hiremath wrote: > As part of ?pytest_sessionfinish? we are doing few major activities (collecting cluster logs, artifacts, screen shots & videos of testing and moving to central location), > so if kill the pytest based on global timeout then i will lose all the important data which is required for analyzing. > > Oh right, forgot you mentioned that. > > Currently pytest-timeout kills the process when a test times out, I guess it would be possible to change it to call an optional custom function that you can use to do your cleanup routines before it effectively kills the process. > > import pytest_timeout > from mylib import collect_artifacts_videos_and_move_them > > pytest_timeout.before_process_kill = collect_artifacts_videos_and_move_them > > def pytest_sessionfinish(): > collect_artifacts_videos_and_move_them() > Your clean up routines would have to be resilient enough to be called even if a test has not finished yet, however. > > Another option is to do something similar to what is done in pytest-timeout in terms of stopping test execution, but instead of killing the process you have to set some kind of flag/file/whatever which is monitored by the code under execution. When that flag/file is set, your code will have to explicitly bail out of whatever it is doing, and then the pytest test session would finish normally. One way to stop the section is to set the ?shouldstop? attribute as I demonstrated earlier. > > Hope that helps, > Bruno. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From opensource at ronnypfannschmidt.de Wed Apr 20 17:18:31 2016 From: opensource at ronnypfannschmidt.de (Ronny Pfannschmidt) Date: Wed, 20 Apr 2016 23:18:31 +0200 Subject: [pytest-dev] issue tracker labeling for sprint preps Message-ID: <5717F227.60607@ronnypfannschmidt.de> Hi all, for obsessive planing i created https://github.com/pytest-dev/pytest/labels/sprint-candidate i hope it can be a useful tool, lets take a look at how things turn out. -- Ronny From alexamici at gmail.com Thu Apr 21 02:58:50 2016 From: alexamici at gmail.com (Alessandro Amici) Date: Thu, 21 Apr 2016 06:58:50 +0000 Subject: [pytest-dev] Optional static typing plugin? Message-ID: Hey, I'm starting using python 3 optional static typing and the mypy checker in one of my projects and it's working quite nicely, but I could not find a mypy, or any other static typing checker, plugin for pytest, so I'm now left to run two independent tools for every quality control check. Is there a way to check optional static typing from within pytest, that I overlooked? Is anybody working on a mypy plugin of anything comparable? In anybody else interested? Cheers, Alessandro -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Thu Apr 21 03:08:52 2016 From: me at the-compiler.org (Florian Bruhin) Date: Thu, 21 Apr 2016 09:08:52 +0200 Subject: [pytest-dev] Optional static typing plugin? In-Reply-To: References: Message-ID: <20160421070852.GS2984@tonks> Hey, * Alessandro Amici [2016-04-21 06:58:50 +0000]: > I'm starting using python 3 optional static typing and the mypy checker in > one of my projects and it's working quite nicely, but I could not find a > mypy, or any other static typing checker, plugin for pytest, so I'm now > left to run two independent tools for every quality control check. > > Is there a way to check optional static typing from within pytest, that I > overlooked? > > Is anybody working on a mypy plugin of anything comparable? Nothing I'm aware of. But I think it should be quite easy to write something based on e.g. pytest-flakes[1]. I did so with pytest-mccabe[2] and it was really straightforward. > In anybody else interested? I stopped using pytest-{flakes,pep8,pep257,mccabe} myself and switched back to flake8 again, as it's more powerful/configurable. So personally I'd prefer a flake8-mypy or running it directly. What I'd really like though is something validating types dynamically at *runtime* while running the testsuite. It'd be a much more thorough check of the types (assuming a good testsuite) and while slow, you could only run it selectively. There's [3]/[4] but that only runs on explicitly decorated functions. Florian [1] https://github.com/fschulze/pytest-flakes [2] https://github.com/The-Compiler/pytest-mccabe [3] https://pypi.python.org/pypi/typecheck-decorator [4] https://github.com/agronholm/typeguard -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I'm running a crowdfunding to work on my FOSS-project full-time: http://igg.me/at/qutebrowser -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From alexamici at gmail.com Thu Apr 21 03:48:15 2016 From: alexamici at gmail.com (Alessandro Amici) Date: Thu, 21 Apr 2016 07:48:15 +0000 Subject: [pytest-dev] Optional static typing plugin? In-Reply-To: <20160421070852.GS2984@tonks> References: <20160421070852.GS2984@tonks> Message-ID: Florian, On Thu, 21 Apr 2016 at 09:09 Florian Bruhin wrote: > > > In anybody else interested? > > I stopped using pytest-{flakes,pep8,pep257,mccabe} myself and switched > back to flake8 again, as it's more powerful/configurable. > > So personally I'd prefer a flake8-mypy or running it directly. > I see the point, but I consider pyflakes and mypy more in the "code correctness" league than the others, that really focus on long term maintainability, so I'd like to have mypy errors handled the same way as test failures. Doing a new plugin myself is not out of question, but not in the very short term. But if anybody else takes the leadership I'm willing to collaborate. What I'd really like though is something validating types dynamically > at *runtime* while running the testsuite. It'd be a much more thorough > check of the types (assuming a good testsuite) and while slow, you > could only run it selectively. > > There's [3]/[4] but that only runs on explicitly decorated functions. > > [1] https://github.com/fschulze/pytest-flakes > [2] https://github.com/The-Compiler/pytest-mccabe > [3] https://pypi.python.org/pypi/typecheck-decorator > [4] https://github.com/agronholm/typeguard I'll have a look as well, thanks! Alessandro -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Fri Apr 22 05:59:22 2016 From: holger at merlinux.eu (holger krekel) Date: Fri, 22 Apr 2016 11:59:22 +0200 Subject: [pytest-dev] Participation in Pytest sprint In-Reply-To: References: Message-ID: <20160422095922.GO16967@uwanda> Dear Ana, On Mon, Apr 18, 2016 at 16:28 -0300, Ana Ribeiro wrote: > Hello! > > My name is Ana and I am an almost 20 years old girl from Brazil (my > birthday is on may) and this year I am going to work with Pytest this > summer in an internship program named "Outreachy" ( > https://github.com/davehunt/pytest-html#outreachy). I am going to London to > participate in "All Hands" Mozilla meeting and my mentor (Dave Hunt) said > that after this week he is going to Germany to participate in this sprint ( > http://pytest.org/latest/announce/sprint2016.html), and we think that is a > great idea if I go as well since I will have the chance to meet so many > expert people and get help of you all on the development of my project. > > The funding I need is to cover my travel expenses from London to Freiburg > (I looked for some flights and trains and I think it is about 200?) and a > place to stay (I would love to stay with everyone in the same house/flat) > and maybe money for some food or some food. we (*) had a meeting yesterday and happily agreed on providing the funds. As to accomodation there'll be two rooms and bedding at my house and maybe you could share one with Brianna? The other room could then be used by Florian and maybe also a second person. Also Andreas Pelme is going to rent an apartment where two others can stay likely. So i think you can book your travels now and also add yourself to the https://github.com/pytest-dev/pytest/wiki/sprint2016/ page :) cheers, holger (*) we is currently: Bruno Oliveira, Florian Bruhin, Brianna Laugher, Floris Bruynooghe, Ronny Pfannschmidt and me. > Regards, > Ana From holger at merlinux.eu Fri Apr 22 06:05:28 2016 From: holger at merlinux.eu (holger krekel) Date: Fri, 22 Apr 2016 12:05:28 +0200 Subject: [pytest-dev] pytest sprint In-Reply-To: References: <20160327163950.GO11428@tonks> <20160327182754.GI3763@uwanda> Message-ID: <20160422100528.GP16967@uwanda> Hey Sivan, as with Ana Ribeira who i also just answered here with the list we agreed to provide USD 450 from the funds for supporting your travel. As to accomodation i can't promise right now but think some support might be possible as well. Maybe something is possible with Andreas Pelme or, depending on your preferences, you might checkout the Black Forest hostel which is quite close to my place and has 20/30 EUR per night options. If you have settled your travel please add yourself to the https://github.com/pytest-dev/pytest/wiki/sprint2016/ sprint page. holger On Tue, Mar 29, 2016 at 12:17 +0300, Sivan Greenberg wrote: > Hey Holger, > > > > I'll be coming from Tel Aviv, a flight to Frankfurt / Berlin would be > > > > around 450$ or a bit less, Skyscanner does not show me how can one get > > from > > > > Tel Aviv to Freiburg via air travel. Perhaps a train is needed? :) (Is > > > > Freiburg in Switzerland , or ?.. A bit confused after my googling). > > > > Sivan, are you stating the cost because you need funding for your travel? > > > > > Indeed, I could probably handle the dailies, but the travel (+train) costs > are tricky, given my weak currency and turning freelancer not long ago..how > cheap/expensive is the region compared to Berlin? > > > > So far i thought we would fund travel costs for contributors, i.e. people > > who have submitted PRs and/or cared for pytest core or plugin development > > in some ways. However, I am open to consider providing some funds for > > newcomers. > > > > > I had assumed that , but then reading the call for participation it was > mentioned newcomers with experience could be considered, so I decided to > reach out. I thought this was intentional as other open source groups do it > from time to time. > > FWIW, i plan to fix the sprint location till wednesday. It's likely > > > going to be a bit on the outskirts but it will be within a 5 minute > > train reach from the main station. Therefore going for accomodation in > > the city center is perfectly fine. More infos later in the week, > > just arrived back from a little vacation. > > > > I hope I can practice a bit of my now rusting but > used-to-be-okay-beginners-1 university learned German if I get there :) > > I'll keep watching the list. Let me know if you accept my consideration, > and I shall add myself to the sprint list as per Florian's instruction > under 'unconfirmed' or some-such. > > Thanks for you prompt reply, > > -Sivan From sivan at vitakka.co Fri Apr 22 06:37:39 2016 From: sivan at vitakka.co (Sivan Greenberg) Date: Fri, 22 Apr 2016 13:37:39 +0300 Subject: [pytest-dev] Participation in Pytest sprint In-Reply-To: <20160422095922.GO16967@uwanda> References: <20160422095922.GO16967@uwanda> Message-ID: Holger, Thank you for the update! I'd also rather share a place with everyone else as I'm used to with other sprints I've attended. But what is the probability of space availability ? (That sentence turned out overly mathmatic :p) Sivan On 22 Apr 2016 13:04, "holger krekel" wrote: > Dear Ana, > > On Mon, Apr 18, 2016 at 16:28 -0300, Ana Ribeiro wrote: > > Hello! > > > > My name is Ana and I am an almost 20 years old girl from Brazil (my > > birthday is on may) and this year I am going to work with Pytest this > > summer in an internship program named "Outreachy" ( > > https://github.com/davehunt/pytest-html#outreachy). I am going to > London to > > participate in "All Hands" Mozilla meeting and my mentor (Dave Hunt) said > > that after this week he is going to Germany to participate in this > sprint ( > > http://pytest.org/latest/announce/sprint2016.html), and we think that > is a > > great idea if I go as well since I will have the chance to meet so many > > expert people and get help of you all on the development of my project. > > > > The funding I need is to cover my travel expenses from London to Freiburg > > (I looked for some flights and trains and I think it is about 200?) and a > > place to stay (I would love to stay with everyone in the same house/flat) > > and maybe money for some food or some food. > > we (*) had a meeting yesterday and happily agreed on providing the funds. > As to accomodation there'll be two rooms and bedding at my house and maybe > you > could share one with Brianna? The other room could then be used by > Florian and maybe > also a second person. Also Andreas Pelme is going to rent an apartment > where two others can stay likely. > > So i think you can book your travels now and also add yourself to the > https://github.com/pytest-dev/pytest/wiki/sprint2016/ page :) > > cheers, > holger > > (*) we is currently: Bruno Oliveira, Florian Bruhin, Brianna Laugher, > Floris Bruynooghe, > Ronny Pfannschmidt and me. > > > Regards, > > Ana > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Fri Apr 22 06:39:33 2016 From: holger at merlinux.eu (holger krekel) Date: Fri, 22 Apr 2016 12:39:33 +0200 Subject: [pytest-dev] Participation in Pytest sprint In-Reply-To: References: <20160422095922.GO16967@uwanda> Message-ID: <20160422103933.GS16967@uwanda> On Fri, Apr 22, 2016 at 13:37 +0300, Sivan Greenberg wrote: > Holger, > > Thank you for the update! I'd also rather share a place with everyone > else as I'm used to with other sprints I've attended. my flat is kind of limited, though :) Otherwise people are staying at different places ... > But what is the probability of space availability ? (That sentence turned > out overly mathmatic :p) 0.6 maybe? :) holger > Sivan > On 22 Apr 2016 13:04, "holger krekel" wrote: > > > Dear Ana, > > > > On Mon, Apr 18, 2016 at 16:28 -0300, Ana Ribeiro wrote: > > > Hello! > > > > > > My name is Ana and I am an almost 20 years old girl from Brazil (my > > > birthday is on may) and this year I am going to work with Pytest this > > > summer in an internship program named "Outreachy" ( > > > https://github.com/davehunt/pytest-html#outreachy). I am going to > > London to > > > participate in "All Hands" Mozilla meeting and my mentor (Dave Hunt) said > > > that after this week he is going to Germany to participate in this > > sprint ( > > > http://pytest.org/latest/announce/sprint2016.html), and we think that > > is a > > > great idea if I go as well since I will have the chance to meet so many > > > expert people and get help of you all on the development of my project. > > > > > > The funding I need is to cover my travel expenses from London to Freiburg > > > (I looked for some flights and trains and I think it is about 200?) and a > > > place to stay (I would love to stay with everyone in the same house/flat) > > > and maybe money for some food or some food. > > > > we (*) had a meeting yesterday and happily agreed on providing the funds. > > As to accomodation there'll be two rooms and bedding at my house and maybe > > you > > could share one with Brianna? The other room could then be used by > > Florian and maybe > > also a second person. Also Andreas Pelme is going to rent an apartment > > where two others can stay likely. > > > > So i think you can book your travels now and also add yourself to the > > https://github.com/pytest-dev/pytest/wiki/sprint2016/ page :) > > > > cheers, > > holger > > > > (*) we is currently: Bruno Oliveira, Florian Bruhin, Brianna Laugher, > > Floris Bruynooghe, > > Ronny Pfannschmidt and me. > > > > > Regards, > > > Ana > > _______________________________________________ > > pytest-dev mailing list > > pytest-dev at python.org > > https://mail.python.org/mailman/listinfo/pytest-dev > > From sivan at vitakka.co Fri Apr 22 06:51:46 2016 From: sivan at vitakka.co (Sivan Greenberg) Date: Fri, 22 Apr 2016 13:51:46 +0300 Subject: [pytest-dev] Participation in Pytest sprint In-Reply-To: <20160422103933.GS16967@uwanda> References: <20160422095922.GO16967@uwanda> <20160422103933.GS16967@uwanda> Message-ID: :) 60% is not bad, I just want to know for sure if I need to check out a hostel because most of those require pre-booking and sometimes bare a cancellation fee. So I think it's best if we make a bed list and iron it out such that those requiring hostel booking can consider it in their plans. Hope this makes sense :) On 22 Apr 2016 13:39, "holger krekel" wrote: > On Fri, Apr 22, 2016 at 13:37 +0300, Sivan Greenberg wrote: > > Holger, > > > > Thank you for the update! I'd also rather share a place with everyone > > else as I'm used to with other sprints I've attended. > > my flat is kind of limited, though :) > Otherwise people are staying at different places ... > > > But what is the probability of space availability ? (That sentence turned > > out overly mathmatic :p) > > 0.6 maybe? :) > holger > > > > Sivan > > On 22 Apr 2016 13:04, "holger krekel" wrote: > > > > > Dear Ana, > > > > > > On Mon, Apr 18, 2016 at 16:28 -0300, Ana Ribeiro wrote: > > > > Hello! > > > > > > > > My name is Ana and I am an almost 20 years old girl from Brazil (my > > > > birthday is on may) and this year I am going to work with Pytest this > > > > summer in an internship program named "Outreachy" ( > > > > https://github.com/davehunt/pytest-html#outreachy). I am going to > > > London to > > > > participate in "All Hands" Mozilla meeting and my mentor (Dave Hunt) > said > > > > that after this week he is going to Germany to participate in this > > > sprint ( > > > > http://pytest.org/latest/announce/sprint2016.html), and we think > that > > > is a > > > > great idea if I go as well since I will have the chance to meet so > many > > > > expert people and get help of you all on the development of my > project. > > > > > > > > The funding I need is to cover my travel expenses from London to > Freiburg > > > > (I looked for some flights and trains and I think it is about 200?) > and a > > > > place to stay (I would love to stay with everyone in the same > house/flat) > > > > and maybe money for some food or some food. > > > > > > we (*) had a meeting yesterday and happily agreed on providing the > funds. > > > As to accomodation there'll be two rooms and bedding at my house and > maybe > > > you > > > could share one with Brianna? The other room could then be used by > > > Florian and maybe > > > also a second person. Also Andreas Pelme is going to rent an apartment > > > where two others can stay likely. > > > > > > So i think you can book your travels now and also add yourself to the > > > https://github.com/pytest-dev/pytest/wiki/sprint2016/ page :) > > > > > > cheers, > > > holger > > > > > > (*) we is currently: Bruno Oliveira, Florian Bruhin, Brianna Laugher, > > > Floris Bruynooghe, > > > Ronny Pfannschmidt and me. > > > > > > > Regards, > > > > Ana > > > _______________________________________________ > > > pytest-dev mailing list > > > pytest-dev at python.org > > > https://mail.python.org/mailman/listinfo/pytest-dev > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aninhacostaribeiro at gmail.com Fri Apr 22 11:58:41 2016 From: aninhacostaribeiro at gmail.com (Ana Ribeiro) Date: Fri, 22 Apr 2016 12:58:41 -0300 Subject: [pytest-dev] Participation in Pytest sprint In-Reply-To: <20160422095922.GO16967@uwanda> References: <20160422095922.GO16967@uwanda> Message-ID: Hi Holger! For me it is not a problem at all sharing rooms with Brianna :) As far as I understood from the other thread, you are going to give me U$D 450,00 plus the accommodation in a shared room with Brianna, right? If so, are you going to transfer the money using PayPal or something? If so, it would help me to book my travel, because I do have an international credit card but I have had some problems with it (seems it has been cloned) so I blocked it and asked a new one to my bank this Tuesday, so they are going to send me a new credit card and as far as the Brazilian mail system is not the best in the world at all, I think I will only have it back in two weeks :( But most of the travel sites I've checked accepts PayPal, so if you could transfer it to me I could book my travels :) Regards, Ana 2016-04-22 6:59 GMT-03:00 holger krekel : > Dear Ana, > > On Mon, Apr 18, 2016 at 16:28 -0300, Ana Ribeiro wrote: > > Hello! > > > > My name is Ana and I am an almost 20 years old girl from Brazil (my > > birthday is on may) and this year I am going to work with Pytest this > > summer in an internship program named "Outreachy" ( > > https://github.com/davehunt/pytest-html#outreachy). I am going to > London to > > participate in "All Hands" Mozilla meeting and my mentor (Dave Hunt) said > > that after this week he is going to Germany to participate in this > sprint ( > > http://pytest.org/latest/announce/sprint2016.html), and we think that > is a > > great idea if I go as well since I will have the chance to meet so many > > expert people and get help of you all on the development of my project. > > > > The funding I need is to cover my travel expenses from London to Freiburg > > (I looked for some flights and trains and I think it is about 200?) and a > > place to stay (I would love to stay with everyone in the same house/flat) > > and maybe money for some food or some food. > > we (*) had a meeting yesterday and happily agreed on providing the funds. > As to accomodation there'll be two rooms and bedding at my house and maybe > you > could share one with Brianna? The other room could then be used by > Florian and maybe > also a second person. Also Andreas Pelme is going to rent an apartment > where two others can stay likely. > > So i think you can book your travels now and also add yourself to the > https://github.com/pytest-dev/pytest/wiki/sprint2016/ page :) > > cheers, > holger > > (*) we is currently: Bruno Oliveira, Florian Bruhin, Brianna Laugher, > Floris Bruynooghe, > Ronny Pfannschmidt and me. > > > Regards, > > Ana > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sivan at vitakka.co Sat Apr 23 05:52:44 2016 From: sivan at vitakka.co (Sivan Greenberg) Date: Sat, 23 Apr 2016 12:52:44 +0300 Subject: [pytest-dev] Participation in Pytest sprint In-Reply-To: References: <20160422095922.GO16967@uwanda> Message-ID: Hey Anna, On Fri, Apr 22, 2016 at 6:58 PM, Ana Ribeiro wrote: > Hi Holger! > > For me it is not a problem at all sharing rooms with Brianna :) > > As far as I understood from the other thread, you are going to give me U$D > 450,00 plus the accommodation in a shared room with Brianna, right? If so, > are you going to transfer the money > Holger would be the authority on this - but I think the sums are individual as everybody comes from a different place. For me the flights alone (and I still need take a train to Freiburg ) would cost that much as I'm coming from another continent, but if you're coming from Europe (as I understood in your previous thread) that should be around 200EU indeed as you stated :) -Sivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From aninhacostaribeiro at gmail.com Sat Apr 23 06:12:22 2016 From: aninhacostaribeiro at gmail.com (Ana Ribeiro) Date: Sat, 23 Apr 2016 07:12:22 -0300 Subject: [pytest-dev] Participation in Pytest sprint In-Reply-To: References: <20160422095922.GO16967@uwanda> Message-ID: Thanks Sivan, I just accorded with in private messages with Holger and you were right :) so see you in Germany =) Cheers, Ana 2016-04-23 6:52 GMT-03:00 Sivan Greenberg : > Hey Anna, > > On Fri, Apr 22, 2016 at 6:58 PM, Ana Ribeiro > wrote: > >> Hi Holger! >> >> For me it is not a problem at all sharing rooms with Brianna :) >> >> As far as I understood from the other thread, you are going to give me >> U$D 450,00 plus the accommodation in a shared room with Brianna, right? If >> so, are you going to transfer the money >> > > Holger would be the authority on this - but I think the sums are > individual as everybody comes from a different place. For me the flights > alone (and I still need take a train to Freiburg ) would cost that much as > I'm coming from another continent, but if you're coming from Europe (as I > understood in your previous thread) that should be around 200EU indeed as > you stated :) > > -Sivan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.schulze at gmx.net Thu Apr 28 06:57:14 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Thu, 28 Apr 2016 12:57:14 +0200 Subject: [pytest-dev] Timing tests and fixtures Message-ID: <33464023-6BA2-4A0E-93AC-804129B125F7@gmx.net> Hi! Is there a plugin to measure the execution time of tests and fixtures and the usage count of fixtures? There seems to be a profile plugin, but that is way to detailed for my need. I want to find slow tests and fixtures to see if I can optimize them. Regards, Florian Schulze From rpfannsc at redhat.com Thu Apr 28 07:44:12 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Thu, 28 Apr 2016 13:44:12 +0200 Subject: [pytest-dev] Timing tests and fixtures In-Reply-To: <33464023-6BA2-4A0E-93AC-804129B125F7@gmx.net> References: <33464023-6BA2-4A0E-93AC-804129B125F7@gmx.net> Message-ID: we currently do any reporting/logging on fixtures, we don't even have the base of a system for that -- Ronny On Thu, Apr 28, 2016 at 12:57 PM, Florian Schulze wrote: > Hi! > > Is there a plugin to measure the execution time of tests and fixtures and > the usage count of fixtures? There seems to be a profile plugin, but that > is way to detailed for my need. I want to find slow tests and fixtures to > see if I can optimize them. > > Regards, > Florian Schulze > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Thu Apr 28 08:00:21 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Thu, 28 Apr 2016 12:00:21 +0000 Subject: [pytest-dev] Timing tests and fixtures In-Reply-To: <33464023-6BA2-4A0E-93AC-804129B125F7@gmx.net> References: <33464023-6BA2-4A0E-93AC-804129B125F7@gmx.net> Message-ID: On Thu, Apr 28, 2016 at 7:57 AM Florian Schulze wrote: > Is there a plugin to measure the execution time of tests and fixtures > and the usage count of fixtures? > Hi Florian, I don't know about fixtures, but the --durations=N option will show the slowest N tests (0 for all). Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kvas.it at gmail.com Thu Apr 28 07:55:48 2016 From: kvas.it at gmail.com (Vasily Kuznetsov) Date: Thu, 28 Apr 2016 11:55:48 +0000 Subject: [pytest-dev] Testing of console scripts Message-ID: Hi! I was recently writing some tests for a bunch of console scripts. I ended up having a parametrised function that can run a script for real (using subprocess.run) or can import its main function, mock the environment and execute it in the same process (this is much faster). I've done similar things before and in general this seems to be a reasonably common use case. I couldn't find a pytest plugin for testing console scripts, so I'm wondering if it would be useful to create one. What do you think? Cheers, Vasily -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Thu Apr 28 08:11:08 2016 From: me at the-compiler.org (Florian Bruhin) Date: Thu, 28 Apr 2016 14:11:08 +0200 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: Message-ID: <20160428121108.GL18629@tonks> * Vasily Kuznetsov [2016-04-28 11:55:48 +0000]: > I was recently writing some tests for a bunch of console scripts. I ended > up having a parametrised function that can run a script for real (using > subprocess.run) or can import its main function, mock the environment and > execute it in the same process (this is much faster). That's basically what pytest itself does with the pytester/testdir fixture too: https://github.com/pytest-dev/pytest/blob/master/_pytest/pytester.py > I've done similar things before and in general this seems to be a > reasonably common use case. I couldn't find a pytest plugin for testing > console scripts, so I'm wondering if it would be useful to create one. What > do you think? FWIW there's pytest-cram which has a totally different approach, but seemed quite interesting: https://github.com/tbekolay/pytest-cram https://bitheap.org/cram/ Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From rpfannsc at redhat.com Thu Apr 28 08:14:26 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Thu, 28 Apr 2016 14:14:26 +0200 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: Message-ID: click for example ships libraries for testing commandlines made with it my current impression is that typically command line applications are opinionated enough, that deep integration is very custom and shallow integration is so shallow a plugin would either be application specific or so small that many wouldn't see much value in it that being said, my impression is a sad one, and i'd love to be shown wrong On Thu, Apr 28, 2016 at 1:55 PM, Vasily Kuznetsov wrote: > Hi! > > I was recently writing some tests for a bunch of console scripts. I ended > up having a parametrised function that can run a script for real (using > subprocess.run) or can import its main function, mock the environment and > execute it in the same process (this is much faster). > > I've done similar things before and in general this seems to be a > reasonably common use case. I couldn't find a pytest plugin for testing > console scripts, so I'm wondering if it would be useful to create one. What > do you think? > > Cheers, > Vasily > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at ionelmc.ro Thu Apr 28 09:15:34 2016 From: contact at ionelmc.ro (=?UTF-8?Q?Ionel_Cristian_M=C4=83rie=C8=99?=) Date: Thu, 28 Apr 2016 16:15:34 +0300 Subject: [pytest-dev] Testing of console scripts In-Reply-To: <20160428121108.GL18629@tonks> References: <20160428121108.GL18629@tonks> Message-ID: On Thu, Apr 28, 2016 at 3:11 PM, Florian Bruhin wrote: > FWIW there's pytest-cram which has a totally different approach, but > seemed quite interesting: > > https://github.com/tbekolay/pytest-cram > https://bitheap.org/cram/ > ?Cram is indeed nice but it doesn't really work on Windows so I eventually moved my stuff from there to good old pytester? plugin. Pytester is not that bad, it will be fine for most of the console apps. It won't be good for interactive console apps, but most apps aren't interactive (IMO). For interactive apps there's pexpect . It looks like it supports Windows since 4.0 ... gotta try it. Thanks, -- Ionel Cristian M?rie?, http://blog.ionelmc.ro -------------- next part -------------- An HTML attachment was scrubbed... URL: From kvas.it at gmail.com Thu Apr 28 09:21:16 2016 From: kvas.it at gmail.com (Vasily Kuznetsov) Date: Thu, 28 Apr 2016 13:21:16 +0000 Subject: [pytest-dev] Testing of console scripts In-Reply-To: <20160428121108.GL18629@tonks> References: <20160428121108.GL18629@tonks> Message-ID: Thanks for the pointers, Florian. The testdir fixture from pytest is pretty much what I was thinking about. So if we could have a more generic version of it, wouldn't it be cool? pytest-cram and cram in general looks quite neat, but I guess it doesn't allow the second approach of running everything in the same python process, which is an important feature for example for doing TDD. Vasily On Thu, Apr 28, 2016 at 2:11 PM Florian Bruhin wrote: > * Vasily Kuznetsov [2016-04-28 11:55:48 +0000]: > > I was recently writing some tests for a bunch of console scripts. I ended > > up having a parametrised function that can run a script for real (using > > subprocess.run) or can import its main function, mock the environment and > > execute it in the same process (this is much faster). > > That's basically what pytest itself does with the pytester/testdir > fixture too: > > https://github.com/pytest-dev/pytest/blob/master/_pytest/pytester.py > > > I've done similar things before and in general this seems to be a > > reasonably common use case. I couldn't find a pytest plugin for testing > > console scripts, so I'm wondering if it would be useful to create one. > What > > do you think? > > FWIW there's pytest-cram which has a totally different approach, but > seemed quite interesting: > > https://github.com/tbekolay/pytest-cram > https://bitheap.org/cram/ > > Florian > > -- > http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) > GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc > I love long mails! | http://email.is-not-s.ms/ > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kvas.it at gmail.com Thu Apr 28 09:30:18 2016 From: kvas.it at gmail.com (Vasily Kuznetsov) Date: Thu, 28 Apr 2016 13:30:18 +0000 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: Message-ID: Well, I was just thinking that all scripts that are exposed using console_scripts entry point from setup.py could be tested in a similar way to how the standard script wrappers run this code. We would need to mock some things and do clean up afterwards and it would work for most simple use cases. So this indeed doesn't seem like a lot of code, but it would be useful. Perhaps not only for me. On Thu, Apr 28, 2016 at 2:14 PM Ronny Pfannschmidt wrote: > > > click for example ships libraries for testing commandlines made with it > > my current impression is that > typically command line applications are opinionated enough, > that deep integration is very custom and shallow integration is so shallow > > a plugin would either be application specific or so small that many > wouldn't see much value in it > > that being said, my impression is a sad one, and i'd love to be shown wrong > > On Thu, Apr 28, 2016 at 1:55 PM, Vasily Kuznetsov > wrote: > >> Hi! >> >> I was recently writing some tests for a bunch of console scripts. I ended >> up having a parametrised function that can run a script for real (using >> subprocess.run) or can import its main function, mock the environment and >> execute it in the same process (this is much faster). >> >> I've done similar things before and in general this seems to be a >> reasonably common use case. I couldn't find a pytest plugin for testing >> console scripts, so I'm wondering if it would be useful to create one. What >> do you think? >> >> Cheers, >> Vasily >> >> _______________________________________________ >> pytest-dev mailing list >> pytest-dev at python.org >> https://mail.python.org/mailman/listinfo/pytest-dev >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at ionelmc.ro Thu Apr 28 09:33:12 2016 From: contact at ionelmc.ro (=?UTF-8?Q?Ionel_Cristian_M=C4=83rie=C8=99?=) Date: Thu, 28 Apr 2016 16:33:12 +0300 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: <20160428121108.GL18629@tonks> Message-ID: On Thu, Apr 28, 2016 at 4:21 PM, Vasily Kuznetsov wrote: > > pytest-cram and cram in general looks quite neat, but I guess it doesn't > allow the second approach of running everything in the same python process, > which is an important feature for example for doing TDD. > ?That reminds me of that time I decided to do in-process testing, cause TDD and I had just a bunch of functions around, nothing special right? Too bad I forgot the console app used os.execv? inside. Looked mystified for a while at why pytest suddenly exits. Can't say how long - a bit too embarrassing. ?The point I'm trying to make is that subprocess tests (in the same vein as integration tests) are the way to go if you want to ensure the users are going to get exactly same behavior you get in the test suite.? Thanks, -- Ionel Cristian M?rie?, http://blog.ionelmc.ro -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.schulze at gmx.net Thu Apr 28 09:58:29 2016 From: florian.schulze at gmx.net (Florian Schulze) Date: Thu, 28 Apr 2016 15:58:29 +0200 Subject: [pytest-dev] Timing tests and fixtures In-Reply-To: References: <33464023-6BA2-4A0E-93AC-804129B125F7@gmx.net> Message-ID: Ahh, I knew I read about such an option at some point. Thanks for the reminder. Looks like pytest doesn't have the necessary hooks to measure fixture calls. Regards, Florian Schulze On 28 Apr 2016, at 14:00, Bruno Oliveira wrote: > On Thu, Apr 28, 2016 at 7:57 AM Florian Schulze > > wrote: > >> Is there a plugin to measure the execution time of tests and fixtures >> and the usage count of fixtures? >> > > Hi Florian, > > I don't know about fixtures, but the --durations=N option will show > the > slowest N tests (0 for all). > > Cheers, > Bruno. From kvas.it at gmail.com Thu Apr 28 12:19:38 2016 From: kvas.it at gmail.com (Vasily Kuznetsov) Date: Thu, 28 Apr 2016 16:19:38 +0000 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: <20160428121108.GL18629@tonks> Message-ID: Yes, exactly, I want to do both (in-process and subprocess). So while I'm hacking on the new features I'd run in-process for speed and then I'd use something like tox to run proper subprocess tests in different environments. And those would be the same tests, I'd just change some configuration setting to switch between the two approaches. And there are indeed limitations to the in-process approach, like the one you described, so perhaps it would be useful to be able to override the config setting in particular tests that don't work with it. On Thu, Apr 28, 2016 at 3:33 PM Ionel Cristian M?rie? wrote: > > On Thu, Apr 28, 2016 at 4:21 PM, Vasily Kuznetsov > wrote: > >> >> pytest-cram and cram in general looks quite neat, but I guess it doesn't >> allow the second approach of running everything in the same python process, >> which is an important feature for example for doing TDD. >> > > ?That reminds me of that time I decided to do in-process testing, cause > TDD and I had just a bunch of functions around, nothing special right? Too > bad I forgot the console app used os.execv? inside. Looked mystified for a > while at why pytest suddenly exits. Can't say how long - a bit too > embarrassing. > > ?The point I'm trying to make is that subprocess tests (in the same vein > as integration tests) are the way to go if you want to ensure the users are > going to get exactly same behavior you get in the test suite.? > > > > Thanks, > -- Ionel Cristian M?rie?, http://blog.ionelmc.ro > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Thu Apr 28 12:35:02 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Thu, 28 Apr 2016 16:35:02 +0000 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: <20160428121108.GL18629@tonks> Message-ID: On Thu, Apr 28, 2016 at 1:20 PM Vasily Kuznetsov wrote: > Yes, exactly, I want to do both (in-process and subprocess). So while I'm > hacking on the new features I'd run in-process for speed and then I'd use > something like tox to run proper subprocess tests in different > environments. And those would be the same tests, I'd just change some > configuration setting to switch between the two approaches. > > And there are indeed limitations to the in-process approach, like the one > you described, so perhaps it would be useful to be able to override the > config setting in particular tests that don't work with it. > Having a command line option that can change between the two approaches sounds good, as well as having a mark to always enforce it for a particular test: py.test --script-launch-mode=subprocess py.test --script-launch-mode=inprocess @pytest.mark.script_launch_mode('subprocess') def test_foo(script_tester): result = script_tester.run('script --args') assert result.success result.stdout.fnmatch_lines(...) In your CI server you can choose to run your test suite twice to ensure both modes are working as expected in your test suite. Also, to avoid taking twice as long, the plugin could also automatically mark tests which use the fixture so the second run can execute only those tests. I definitely would like to see a plugin that implements something like this. :) Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kvas.it at gmail.com Thu Apr 28 16:45:23 2016 From: kvas.it at gmail.com (Vasily Kuznetsov) Date: Thu, 28 Apr 2016 20:45:23 +0000 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: <20160428121108.GL18629@tonks> Message-ID: Yeah, this is exactly what I had in mind (articulated in more detail than I had in mind :). I think I'll put some code together when I have a bit of time and then we can see. Thank you, Vasily On Thu, Apr 28, 2016 at 6:35 PM Bruno Oliveira wrote: > On Thu, Apr 28, 2016 at 1:20 PM Vasily Kuznetsov > wrote: > >> Yes, exactly, I want to do both (in-process and subprocess). So while I'm >> hacking on the new features I'd run in-process for speed and then I'd use >> something like tox to run proper subprocess tests in different >> environments. And those would be the same tests, I'd just change some >> configuration setting to switch between the two approaches. >> >> And there are indeed limitations to the in-process approach, like the one >> you described, so perhaps it would be useful to be able to override the >> config setting in particular tests that don't work with it. >> > > Having a command line option that can change between the two approaches > sounds good, as well as having a mark to always enforce it for a particular > test: > > py.test --script-launch-mode=subprocess > py.test --script-launch-mode=inprocess > > @pytest.mark.script_launch_mode('subprocess') > def test_foo(script_tester): > result = script_tester.run('script --args') > assert result.success > result.stdout.fnmatch_lines(...) > > In your CI server you can choose to run your test suite twice to ensure > both modes are working as expected in your test suite. Also, to avoid > taking twice as long, the plugin could also automatically mark tests which > use the fixture so the second run can execute only those tests. > > I definitely would like to see a plugin that implements something like > this. :) > > Cheers, > > Bruno. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Thu Apr 28 16:52:05 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Thu, 28 Apr 2016 20:52:05 +0000 Subject: [pytest-dev] Testing of console scripts In-Reply-To: References: <20160428121108.GL18629@tonks> Message-ID: On Thu, Apr 28, 2016 at 5:45 PM Vasily Kuznetsov wrote: > Yeah, this is exactly what I had in mind (articulated in more detail than > I had in mind :). > I think I'll put some code together when I have a bit of time and then we > can see. > Nice! Make sure to use cookiecutter-pytest-plugin[1] to create the plugin template for you. I can't stress enough how much time that saves you. :) [1] https://github.com/pytest-dev/cookiecutter-pytest-plugin Thanks, Bruno. > -------------- next part -------------- An HTML attachment was scrubbed... URL: