From nicoddemus at gmail.com Tue Mar 1 08:20:44 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 01 Mar 2016 13:20:44 +0000 Subject: [pytest-dev] question about pytest_addoption In-Reply-To: References: Message-ID: Hi Bryan, On Sun, Feb 28, 2016 at 4:21 PM Bryan Berry wrote: > A specific fixture library, say foo_fixture that handles the installation > of some particularly hairy proprietary software, may want to add additional > custom options. Perhaps, we need to pass this fixture a special flag > to enable ipv6 support. > > Here is how I have currently attempted to support this feature and it > isn't working > at all. Could anyone point me towards a working solution? > I didn't study your solution thoroughly, but I would suggest to use the usual pytest hooks instead of trying to come up with your own solution for fixtures to add command line options. Here's how I would do it: # foo_fixture.py def pytest_addoption(parser): parser.addoption('--ipv6', action='store_true', default=False) @pytest.fixture def foo_fixture(request): ipv6 = request.config.getoption('--ipv6') # lots of complicated stuff # conftest.py pytest_plugins = ['foo_fixture'] By using the `pytest_plugins` variable, pytest will load `foo_fixture` as a plugin and automatically call the appropriate hooks and make any fixtures declared in that module available for tests to use. HTH, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryan.berry at gmail.com Tue Mar 1 08:30:46 2016 From: bryan.berry at gmail.com (Bryan Berry) Date: Tue, 1 Mar 2016 08:30:46 -0500 Subject: [pytest-dev] question about pytest_addoption In-Reply-To: References: Message-ID: Hi Bruno, I already successfully use that approach from one fixtures package. However, I want to add command-line options from one or more fixtures packages. Say i use ProductAFixture library that adds a command-line option and ProductBFixture that also adds a command-line option. How can i take advantage of both? On Tue, Mar 1, 2016 at 8:20 AM, Bruno Oliveira wrote: > Hi Bryan, > > On Sun, Feb 28, 2016 at 4:21 PM Bryan Berry wrote: > >> A specific fixture library, say foo_fixture that handles the installation >> of some particularly hairy proprietary software, may want to add >> additional >> custom options. Perhaps, we need to pass this fixture a special flag >> to enable ipv6 support. >> >> Here is how I have currently attempted to support this feature and it >> isn't working >> at all. Could anyone point me towards a working solution? >> > > I didn't study your solution thoroughly, but I would suggest to use the > usual pytest hooks instead of trying to come up with your own solution for > fixtures to add command line options. Here's how I would do it: > > # foo_fixture.py > def pytest_addoption(parser): > parser.addoption('--ipv6', action='store_true', default=False) > > @pytest.fixture > def foo_fixture(request): > ipv6 = request.config.getoption('--ipv6') > # lots of complicated stuff > > # conftest.py > pytest_plugins = ['foo_fixture'] > > By using the `pytest_plugins` variable, pytest will load `foo_fixture` as > a plugin and automatically call the appropriate hooks and make any fixtures > declared in that module available for tests to use. > > HTH, > Bruno. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Tue Mar 1 08:39:49 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 01 Mar 2016 13:39:49 +0000 Subject: [pytest-dev] question about pytest_addoption In-Reply-To: References: Message-ID: On Tue, Mar 1, 2016 at 10:30 AM Bryan Berry wrote: > Hi Bruno, I already successfully use that approach from one fixtures > package. However, I want to add command-line options from one or more > fixtures packages. Say i use ProductAFixture library that adds a > command-line option and ProductBFixture that also adds a command-line > option. How can i take advantage of both? > `pytest_plugins` accepts a list, so in this case is just a matter of: ``` # conftest.py pytest_plugins = ['product_a', 'product_b'] ``` Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Tue Mar 1 16:44:51 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 01 Mar 2016 21:44:51 +0000 Subject: [pytest-dev] Pytest 2.9.0 released Message-ID: Hi everyone, I'm happy to announce that pytest 2.9.0 has been released! pytest is a mature Python testing tool with more than a 1100 tests against itself, passing on many different interpreters and platforms. As usual, you can upgrade using pip: pip install -U pytest To see the changelog, please visit: http://pytest.org/latest/changelog.html Please make sure to report any regressions to the issues page at: https://github.com/pytest-dev/pytest/issues Finally, thanks to all who contributed to this release, among them: Anatoly Bubenkov Bruno Oliveira Buck Golemon David Vierra Florian Bruhin Galaczi Endre Georgy Dyuldin Lukas Bednar Luke Murphy Marcin Biernat Matt Williams Michael Aquilina Raphael Pierzina Ronny Pfannschmidt Ryan Wooden Tiemo Kieft TomV holger krekel jab Happy testing, The py.test Development Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From raphael at hackebrot.de Tue Mar 1 17:41:30 2016 From: raphael at hackebrot.de (Raphael Pierzina) Date: Tue, 1 Mar 2016 22:41:30 +0000 Subject: [pytest-dev] Pytest 2.9.0 released In-Reply-To: References: Message-ID: <3188A24B-6E6A-4D84-9BA2-FD8FF9A4250C@hackebrot.de> Wohoo! Announced on Twitter: https://twitter.com/pytestdotorg/status/704798309811146753 > On 01 Mar 2016, at 21:44, Bruno Oliveira wrote: > > Hi everyone, > > I'm happy to announce that pytest 2.9.0 has been released! > > pytest is a mature Python testing tool with more than a 1100 tests > against itself, passing on many different interpreters and platforms. > > As usual, you can upgrade using pip: > > pip install -U pytest > > To see the changelog, please visit: > > http://pytest.org/latest/changelog.html > > Please make sure to report any regressions to the issues page at: > > https://github.com/pytest-dev/pytest/issues > > Finally, thanks to all who contributed to this release, among them: > > Anatoly Bubenkov Bruno Oliveira Buck Golemon David Vierra Florian Bruhin Galaczi Endre Georgy Dyuldin Lukas Bednar Luke Murphy Marcin Biernat Matt Williams Michael Aquilina Raphael Pierzina Ronny Pfannschmidt Ryan Wooden Tiemo Kieft TomV holger krekel jab > > > Happy testing, > The py.test Development Team > > _______________________________________________ > 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 Fri Mar 4 16:23:57 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Fri, 04 Mar 2016 21:23:57 +0000 Subject: [pytest-dev] Redirect pytest.org over readthedocs In-Reply-To: References: <20160213180708.GI15751@merlinux.eu> Message-ID: Guys, With 2.9.0 out, would anybody like to configure pytest.org to do the redirect? :) Cheers, Bruno. On Sun, Feb 14, 2016 at 2:01 AM Bruno Oliveira wrote: > On Sat, Feb 13, 2016 at 4:07 PM holger krekel wrote: > >> Let's move back quickly, though, if there are any problems. >> So far i have not heart many complaints about pytest.org not working >> apart >> from the recent ssl hickup which should be automated now with letsencrypt. >> > > Agreed! > > Thanks, didn't know the server uses nginx. I poked around a little, and we > already have redirects in `/etc/nginx/sites-enabled/pytest.org.conf`: > > location @rewrites { > rewrite ^(/)?$ http://pytest.org/latest/; > rewrite ^/en/latest/(.*) http://pytest.org/latest/$1; > rewrite ^/(assert.*)$ http://pytest.org/latest/$1; > } > > Would just change those rewrites to docs.pytest.org (and the variants > there) do the trick? Any help here is appreciated. > > *Anyway*, IMHO we shouldn't make any redirect before releasing 2.9. The > recent doc changes are not available on pytest.readthedocs.org yet > because we copied over the files manually. Btw thanks Ronny again for > stepping in. > > Cheers, > Bruno. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raphael at hackebrot.de Wed Mar 9 18:24:16 2016 From: raphael at hackebrot.de (Raphael Pierzina) Date: Wed, 9 Mar 2016 23:24:16 +0000 Subject: [pytest-dev] Sprint participants writing a blog post? In-Reply-To: References: <20160209140953.GH15751@merlinux.eu> <6857A31A-FD3E-434C-8F40-189FBAC5D88C@mozilla.com> <20160211090955.GQ15751@merlinux.eu> <12D72D98-68DC-479A-B95C-76900D50A9E3@hackebrot.de> Message-ID: <7EE2DB47-5F42-4BEE-80FD-C1C9B026A027@hackebrot.de> Hi there, I may have missed it, but has anyone gotten in touch with Brian regarding the podcast interview? Best Raphael > On 16 Feb 2016, at 14:38, Bruno Oliveira wrote: > > Hi Raphael, > > Thanks, but as I said in another e-email, I rather someone else would do the interview. :) > > But I also agree it is a great opportunity. Brian for a long time has been writing about Python testing in general and is a noted pytest fan. > > Cheers > > On Tue, Feb 16, 2016 at 12:28 PM Raphael Pierzina > wrote: > Hi all, > > I think you should go for it, Bruno! :-) > > You have been really active in the past months which makes you a good candidate to speak about ongoing topics, I think. > > I would like to talk with Brian on the Podcast about the sprint - however I am not nearly as involved in core-pytest as others. > > We should definitely take the chance! > > Raphael > >> On 11 Feb 2016, at 21:01, Bruno Oliveira > wrote: >> >> Hi Holger, >> >> TBH I'm a little shy of my english speaking skills, so I rather don't do the interview. :S >> >> Someone else might be more suited! >> >> >> On Thu, Feb 11, 2016 at 7:10 AM holger krekel > wrote: >> >> Hey Bruno, >> >> what about you? You have been incredibly active and it'd be cool to see >> you interviewed :) I think apart from the campaign it'd be interesting >> to talk about pytest-3.0 and xdist improvements that we are looking into ... >> >> best, >> holger >> >> >> On Wed, Feb 10, 2016 at 20:14 +0000, Dave Hunt wrote: >> > We have an invitation to be discuss/promote the sprint on the Python Test Podcast if anyone wants to volunteer! >> > https://twitter.com/brianokken/status/697419561797160960 > >> > >> > Cheers, >> > Dave >> > >> > > On 9 Feb 2016, at 17:16, Dave Hunt > wrote: >> > > >> > > Published: >> > > http://blargon7.com/2016/02/python-testing-sprint-2016/ > >> > > >> > > Dave >> > > >> > >> On 9 Feb 2016, at 14:09, holger krekel >> wrote: >> > >> >> > >> On Tue, Feb 09, 2016 at 14:07 +0000, Dave Hunt wrote: >> > >>> I have a public preview of my blog post. Feedback welcome: >> > >>> http://blargon7.com/?p=204&preview=1&_ppp=65d7c71c07 > >> >> > >> >> > >> reads good! >> > >> >> > >> holger >> > >> >> > >>> Dave >> > >>> >> > >>>> On 9 Feb 2016, at 10:40, Dave Hunt >> wrote: >> > >>>> >> > >>>> I think this is a great idea! I have had approval to join you all during the sprint, so I?d be happy to write a blog post about how I came to pytest and what I?d like to work on during the week. >> > >>>> >> > >>>> Cheers, >> > >>>> Dave >> > >>>> >> > >>>>> On 8 Feb 2016, at 20:05, Brianna Laugher > >>> wrote: >> > >>>>> >> > >>>>> Heh, I had the exact same idea last night :) >> > >>>>> >> > >>>>> I was thinking >> > >>>>> 1) how did you get involved with pytest? >> > >>>>> 2) What is your favourite feature/plugin of pytest that is relatively unknown? >> > >>>>> 3) What are you planning to work on during the sprint? >> > >>>>> >> > >>>>> Cheers >> > >>>>> Brianna >> > >>>>> >> > >>>>> On 09/02/2016 6:04 AM, "Holger Krekel" > >>> wrote: >> > >>>>> What about if each of us who wants to participate writes a small blog (lacking a blog a pytest-dev) post of where he/she comes from, past core or plugin work for example, and main areas of interest for the sprint? >> > >>>>> >> > >>>>> We could publish them via updates every few days. Any takers? >> > >>>>> -- >> > >>>>> Sent using mobile touch keys, increased chances for errors and misunderstandings. Enjoy! >> > >>>>> _______________________________________________ >> > >>>>> 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 > >> > >>>> >> > >>> >> > >> >> > >> -- >> > >> about me: http://holgerkrekel.net/about-me/ > >> > >> contracting: http://merlinux.eu > >> > > >> > >> >> -- >> about me: http://holgerkrekel.net/about-me/ >> contracting: http://merlinux.eu >> _______________________________________________ >> 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 holger at merlinux.eu Thu Mar 10 01:30:27 2016 From: holger at merlinux.eu (Holger Krekel) Date: Thu, 10 Mar 2016 07:30:27 +0100 Subject: [pytest-dev] Sprint participants writing a blog post? In-Reply-To: <7EE2DB47-5F42-4BEE-80FD-C1C9B026A027@hackebrot.de> References: <20160209140953.GH15751@merlinux.eu> <6857A31A-FD3E-434C-8F40-189FBAC5D88C@mozilla.com> <20160211090955.GQ15751@merlinux.eu> <12D72D98-68DC-479A-B95C-76900D50A9E3@hackebrot.de> <7EE2DB47-5F42-4BEE-80FD-C1C9B026A027@hackebrot.de> Message-ID: <14948E74-EBE7-454E-9B0E-D210BA3AD437@merlinux.eu> I haven't gotten back to Brian. Good point reminding us. Anyone? On March 10, 2016 12:24:16 AM GMT+01:00, Raphael Pierzina wrote: >Hi there, > >I may have missed it, but has anyone gotten in touch with Brian >regarding the podcast interview? > >Best >Raphael > >> On 16 Feb 2016, at 14:38, Bruno Oliveira >wrote: >> >> Hi Raphael, >> >> Thanks, but as I said in another e-email, I rather someone else would >do the interview. :) >> >> But I also agree it is a great opportunity. Brian for a long time has >been writing about Python testing in general and is a noted pytest fan. > >> >> Cheers >> >> On Tue, Feb 16, 2016 at 12:28 PM Raphael Pierzina >> wrote: >> Hi all, >> >> I think you should go for it, Bruno! :-) >> >> You have been really active in the past months which makes you a good >candidate to speak about ongoing topics, I think. >> >> I would like to talk with Brian on the Podcast about the sprint - >however I am not nearly as involved in core-pytest as others. >> >> We should definitely take the chance! >> >> Raphael >> >>> On 11 Feb 2016, at 21:01, Bruno Oliveira > wrote: >>> >>> Hi Holger, >>> >>> TBH I'm a little shy of my english speaking skills, so I rather >don't do the interview. :S >>> >>> Someone else might be more suited! >>> >>> >>> On Thu, Feb 11, 2016 at 7:10 AM holger krekel > wrote: >>> >>> Hey Bruno, >>> >>> what about you? You have been incredibly active and it'd be cool to >see >>> you interviewed :) I think apart from the campaign it'd be >interesting >>> to talk about pytest-3.0 and xdist improvements that we are looking >into ... >>> >>> best, >>> holger >>> >>> >>> On Wed, Feb 10, 2016 at 20:14 +0000, Dave Hunt wrote: >>> > We have an invitation to be discuss/promote the sprint on the >Python Test Podcast if anyone wants to volunteer! >>> > https://twitter.com/brianokken/status/697419561797160960 > >> >>> > >>> > Cheers, >>> > Dave >>> > >>> > > On 9 Feb 2016, at 17:16, Dave Hunt > wrote: >>> > > >>> > > Published: >>> > > http://blargon7.com/2016/02/python-testing-sprint-2016/ > >> >>> > > >>> > > Dave >>> > > >>> > >> On 9 Feb 2016, at 14:09, holger krekel >> wrote: >>> > >> >>> > >> On Tue, Feb 09, 2016 at 14:07 +0000, Dave Hunt wrote: >>> > >>> I have a public preview of my blog post. Feedback welcome: >>> > >>> http://blargon7.com/?p=204&preview=1&_ppp=65d7c71c07 > >> > >>> >>> > >> >>> > >> reads good! >>> > >> >>> > >> holger >>> > >> >>> > >>> Dave >>> > >>> >>> > >>>> On 9 Feb 2016, at 10:40, Dave Hunt >> wrote: >>> > >>>> >>> > >>>> I think this is a great idea! I have had approval to join you >all during the sprint, so I?d be happy to write a blog post about how I >came to pytest and what I?d like to work on during the week. >>> > >>>> >>> > >>>> Cheers, >>> > >>>> Dave >>> > >>>> >>> > >>>>> On 8 Feb 2016, at 20:05, Brianna Laugher > >> > >>>> >wrote: >>> > >>>>> >>> > >>>>> Heh, I had the exact same idea last night :) >>> > >>>>> >>> > >>>>> I was thinking >>> > >>>>> 1) how did you get involved with pytest? >>> > >>>>> 2) What is your favourite feature/plugin of pytest that is >relatively unknown? >>> > >>>>> 3) What are you planning to work on during the sprint? >>> > >>>>> >>> > >>>>> Cheers >>> > >>>>> Brianna >>> > >>>>> >>> > >>>>> On 09/02/2016 6:04 AM, "Holger Krekel" > >>> wrote: >>> > >>>>> What about if each of us who wants to participate writes a >small blog (lacking a blog a pytest-dev) post of where he/she comes >from, past core or plugin work for example, and main areas of interest >for the sprint? >>> > >>>>> >>> > >>>>> We could publish them via updates every few days. Any >takers? >>> > >>>>> -- >>> > >>>>> Sent using mobile touch keys, increased chances for errors >and misunderstandings. Enjoy! >>> > >>>>> _______________________________________________ >>> > >>>>> 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 > >> >>> > >>>> >>> > >>> >>> > >> >>> > >> -- >>> > >> about me: http://holgerkrekel.net/about-me/ > > >>> > >> contracting: http://merlinux.eu >> >>> > > >>> > >>> >>> -- >>> about me: http://holgerkrekel.net/about-me/ > >>> contracting: http://merlinux.eu >>> _______________________________________________ >>> 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 brianna.laugher at gmail.com Thu Mar 10 01:41:28 2016 From: brianna.laugher at gmail.com (Brianna Laugher) Date: Thu, 10 Mar 2016 17:41:28 +1100 Subject: [pytest-dev] Sprint participants writing a blog post? In-Reply-To: <14948E74-EBE7-454E-9B0E-D210BA3AD437@merlinux.eu> References: <20160209140953.GH15751@merlinux.eu> <6857A31A-FD3E-434C-8F40-189FBAC5D88C@mozilla.com> <20160211090955.GQ15751@merlinux.eu> <12D72D98-68DC-479A-B95C-76900D50A9E3@hackebrot.de> <7EE2DB47-5F42-4BEE-80FD-C1C9B026A027@hackebrot.de> <14948E74-EBE7-454E-9B0E-D210BA3AD437@merlinux.eu> Message-ID: He emailed me but we stalled on finding a mutually suitable time. Brianna On 10/03/2016 5:30 PM, "Holger Krekel" wrote: > I haven't gotten back to Brian. Good point reminding us. Anyone? > > On March 10, 2016 12:24:16 AM GMT+01:00, Raphael Pierzina < > raphael at hackebrot.de> wrote: >> >> Hi there, >> >> I may have missed it, but has anyone gotten in touch with Brian regarding >> the podcast interview? >> >> Best >> Raphael >> >> On 16 Feb 2016, at 14:38, Bruno Oliveira wrote: >> >> Hi Raphael, >> >> Thanks, but as I said in another e-email, I rather someone else would do >> the interview. :) >> >> But I also agree it is a great opportunity. Brian for a long time has >> been writing about Python testing in general and is a noted pytest fan. >> >> Cheers >> >> On Tue, Feb 16, 2016 at 12:28 PM Raphael Pierzina >> wrote: >> >>> Hi all, >>> >>> I think you should go for it, Bruno! :-) >>> >>> You have been really active in the past months which makes you a good >>> candidate to speak about ongoing topics, I think. >>> >>> I would like to talk with Brian on the Podcast about the sprint - >>> however I am not nearly as involved in core-pytest as others. >>> >>> We should definitely take the chance! >>> >>> Raphael >>> >>> On 11 Feb 2016, at 21:01, Bruno Oliveira wrote: >>> >>> Hi Holger, >>> >>> TBH I'm a little shy of my english speaking skills, so I rather don't do >>> the interview. :S >>> >>> Someone else might be more suited! >>> >>> >>> On Thu, Feb 11, 2016 at 7:10 AM holger krekel >>> wrote: >>> >>>> >>>> Hey Bruno, >>>> >>>> what about you? You have been incredibly active and it'd be cool to see >>>> you interviewed :) I think apart from the campaign it'd be interesting >>>> to talk about pytest-3.0 and xdist improvements that we are looking >>>> into ... >>>> >>>> best, >>>> holger >>>> >>>> >>>> On Wed, Feb 10, 2016 at 20:14 +0000, Dave Hunt wrote: >>>> > We have an invitation to be discuss/promote the sprint on the Python >>>> Test Podcast if anyone wants to volunteer! >>>> > https://twitter.com/brianokken/status/697419561797160960 < >>>> https://twitter.com/brianokken/status/697419561797160960> >>>> > >>>> > Cheers, >>>> > Dave >>>> > >>>> > > On 9 Feb 2016, at 17:16, Dave Hunt wrote: >>>> > > >>>> > > Published: >>>> > > http://blargon7.com/2016/02/python-testing-sprint-2016/ < >>>> http://blargon7.com/2016/02/python-testing-sprint-2016/> >>>> > > >>>> > > Dave >>>> > > >>>> > >> On 9 Feb 2016, at 14:09, holger krekel >>> > wrote: >>>> > >> >>>> > >> On Tue, Feb 09, 2016 at 14:07 +0000, Dave Hunt wrote: >>>> > >>> I have a public preview of my blog post. Feedback welcome: >>>> > >>> http://blargon7.com/?p=204&preview=1&_ppp=65d7c71c07 < >>>> http://blargon7.com/?p=204&preview=1&_ppp=65d7c71c07> < >>>> http://blargon7.com/?p=204&preview=1&_ppp=65d7c71c07 < >>>> http://blargon7.com/?p=204&preview=1&_ppp=65d7c71c07>> >>>> > >> >>>> > >> reads good! >>>> > >> >>>> > >> holger >>>> > >> >>>> > >>> Dave >>>> > >>> >>>> > >>>> On 9 Feb 2016, at 10:40, Dave Hunt >>> dhunt at mozilla.com>> wrote: >>>> > >>>> >>>> > >>>> I think this is a great idea! I have had approval to join you >>>> all during the sprint, so I?d be happy to write a blog post about how I >>>> came to pytest and what I?d like to work on during the week. >>>> > >>>> >>>> > >>>> Cheers, >>>> > >>>> Dave >>>> > >>>> >>>> > >>>>> On 8 Feb 2016, at 20:05, Brianna Laugher < >>>> brianna.laugher at gmail.com >>> brianna.laugher at gmail.com >> wrote: >>>> > >>>>> >>>> > >>>>> Heh, I had the exact same idea last night :) >>>> > >>>>> >>>> > >>>>> I was thinking >>>> > >>>>> 1) how did you get involved with pytest? >>>> > >>>>> 2) What is your favourite feature/plugin of pytest that is >>>> relatively unknown? >>>> > >>>>> 3) What are you planning to work on during the sprint? >>>> > >>>>> >>>> > >>>>> Cheers >>>> > >>>>> Brianna >>>> > >>>>> >>>> > >>>>> On 09/02/2016 6:04 AM, "Holger Krekel" >>> >>> holger at merlinux.eu>>> wrote: >>>> > >>>>> What about if each of us who wants to participate writes a >>>> small blog (lacking a blog a pytest-dev) post of where he/she comes from, >>>> past core or plugin work for example, and main areas of interest for the >>>> sprint? >>>> > >>>>> >>>> > >>>>> We could publish them via updates every few days. Any takers? >>>> > >>>>> -- >>>> > >>>>> Sent using mobile touch keys, increased chances for errors and >>>> misunderstandings. Enjoy! >>>> > >>>>> _______________________________________________ >>>> > >>>>> pytest-dev mailing list >>>> > >>>>> pytest-dev at python.org >>> pytest-dev at python.org > >>>> > >>>>> https://mail.python.org/mailman/listinfo/pytest-dev < >>>> https://mail.python.org/mailman/listinfo/pytest-dev> < >>>> https://mail.python.org/mailman/listinfo/pytest-dev < >>>> https://mail.python.org/mailman/listinfo/pytest-dev>> >>>> > >>>>> >>>> > >>>>> _______________________________________________ >>>> > >>>>> pytest-dev mailing list >>>> > >>>>> pytest-dev at python.org >>> pytest-dev at python.org > >>>> > >>>>> https://mail.python.org/mailman/listinfo/pytest-dev < >>>> https://mail.python.org/mailman/listinfo/pytest-dev> >>>> > >>>> >>>> > >>> >>>> > >> >>>> > >> -- >>>> > >> about me: http://holgerkrekel.net/about-me/ < >>>> http://holgerkrekel.net/about-me/> >>>> > >> contracting: http://merlinux.eu >>>> > > >>>> > >>>> >>>> -- >>>> about me: http://holgerkrekel.net/about-me/ >>>> contracting: http://merlinux.eu >>>> _______________________________________________ >>>> 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 dhunt at mozilla.com Thu Mar 10 08:36:05 2016 From: dhunt at mozilla.com (Dave Hunt) Date: Thu, 10 Mar 2016 13:36:05 +0000 Subject: [pytest-dev] Sprint participants writing a blog post? In-Reply-To: References: <20160209140953.GH15751@merlinux.eu> <6857A31A-FD3E-434C-8F40-189FBAC5D88C@mozilla.com> <20160211090955.GQ15751@merlinux.eu> <12D72D98-68DC-479A-B95C-76900D50A9E3@hackebrot.de> <7EE2DB47-5F42-4BEE-80FD-C1C9B026A027@hackebrot.de> <14948E74-EBE7-454E-9B0E-D210BA3AD437@merlinux.eu> Message-ID: He plugged the campaign in his latest podcast: http://pythontesting.net/podcast/lean-software-development-ptp015/ Dave > On 10 Mar 2016, at 06:41, Brianna Laugher wrote: > > He emailed me but we stalled on finding a mutually suitable time. > > Brianna > > On 10/03/2016 5:30 PM, "Holger Krekel" > wrote: > I haven't gotten back to Brian. Good point reminding us. Anyone? > > On March 10, 2016 12:24:16 AM GMT+01:00, Raphael Pierzina > wrote: > Hi there, > > I may have missed it, but has anyone gotten in touch with Brian regarding the podcast interview? > > Best > Raphael > >> On 16 Feb 2016, at 14:38, Bruno Oliveira > wrote: >> >> Hi Raphael, >> >> Thanks, but as I said in another e-email, I rather someone else would do the interview. :) >> >> But I also agree it is a great opportunity. Brian for a long time has been writing about Python testing in general and is a noted pytest fan. >> >> Cheers >> >> On Tue, Feb 16, 2016 at 12:28 PM Raphael Pierzina > wrote: >> Hi all, >> >> I think you should go for it, Bruno! :-) >> >> You have been really active in the past months which makes you a good candidate to speak about ongoing topics, I think. >> >> I would like to talk with Brian on the Podcast about the sprint - however I am not nearly as involved in core-pytest as others. >> >> We should definitely take the chance! >> >> Raphael >> >>> On 11 Feb 2016, at 21:01, Bruno Oliveira > wrote: >>> >>> Hi Holger, >>> >>> TBH I'm a little shy of my english speaking skills, so I rather don't do the interview. :S >>> >>> Someone else might be more suited! >>> >>> >>> On Thu, Feb 11, 2016 at 7:10 AM holger krekel > wrote: >>> >>> Hey Bruno, >>> >>> what about you? You have been incredibly active and it'd be cool to see >>> you interviewed :) I think apart from the campaign it'd be interesting >>> to talk about pytest-3.0 and xdist improvements that we are looking into ... >>> >>> best, >>> holger >>> >>> >>> On Wed, Feb 10, 2016 at 20:14 +0000, Dave Hunt wrote: >>> > We have an invitation to be discuss/promote the sprint on the Python Test Podcast if anyone wants to volunteer! >>> > https://twitter.com/brianokken/status/697419561797160960 > >>> > >>> > Cheers, >>> > Dave >>> > >>> > > On 9 Feb 2016, at 17:16, Dave Hunt > wrote: >>> > > >>> > > Published: >>> > > http://blargon7.com/2016/02/python-testing-sprint-2016/ > >>> > > >>> > > Dave >>> > > >>> > >> On 9 Feb 2016, at 14:09, holger krekel >> wrote: >>> > >> >>> > >> On Tue, Feb 09, 2016 at 14:07 +0000, Dave Hunt wrote: >>> > >>> I have a public preview of my blog post. Feedback welcome: >>> > >>> http://blargon7.com/?p=204&preview=1&_ppp=65d7c71c07 > >> >>> > >> >>> > >> reads good! >>> > >> >>> > >> holger >>> > >> >>> > >>> Dave >>> > >>> >>> > >>>> On 9 Feb 2016, at 10:40, Dave Hunt >> wrote: >>> > >>>> >>> > >>>> I think this is a great idea! I have had approval to join you all during the sprint, so I?d be happy to write a blog post about how I came to pytest and what I?d like to work on during the week. >>> > >>>> >>> > >>>> Cheers, >>> > >>>> Dave >>> > >>>> >>> > >>>>> On 8 Feb 2016, at 20:05, Brianna Laugher > >>> wrote: >>> > >>>>> >>> > >>>>> Heh, I had the exact same idea last night :) >>> > >>>>> >>> > >>>>> I was thinking >>> > >>>>> 1) how did you get involved with pytest? >>> > >>>>> 2) What is your favourite feature/plugin of pytest that is relatively unknown? >>> > >>>>> 3) What are you planning to work on during the sprint? >>> > >>>>> >>> > >>>>> Cheers >>> > >>>>> Brianna >>> > >>>>> >>> > >>>>> On 09/02/2016 6:04 AM, "Holger Krekel" > >>> wrote: >>> > >>>>> What about if each of us who wants to participate writes a small blog (lacking a blog a pytest-dev) post of where he/she comes from, past core or plugin work for example, and main areas of interest for the sprint? >>> > >>>>> >>> > >>>>> We could publish them via updates every few days. Any takers? >>> > >>>>> -- >>> > >>>>> Sent using mobile touch keys, increased chances for errors and misunderstandings. Enjoy! >>> > >>>>> _______________________________________________ >>> > >>>>> 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 > >>> > >>>> >>> > >>> >>> > >> >>> > >> -- >>> > >> about me: http://holgerkrekel.net/about-me/ > >>> > >> contracting: http://merlinux.eu > >>> > > >>> > >>> >>> -- >>> about me: http://holgerkrekel.net/about-me/ >>> contracting: http://merlinux.eu >>> _______________________________________________ >>> 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 Nikolaus at rath.org Thu Mar 10 17:49:56 2016 From: Nikolaus at rath.org (Nikolaus Rath) Date: Thu, 10 Mar 2016 14:49:56 -0800 Subject: [pytest-dev] Access fixtures in pytest_runtest_call Message-ID: <87egbi3q3v.fsf@thinkpad.rath.org> Hello, Is there a way to access a test's fixtures from the pytest_runtest_call hook? Specifically, I'd like to access the capfd and caplog fixtures to take a peek at the captured output and cause the test to fail if there is anything suspicious. At the moment, I am checking the captured output by using a autouse yield fixture but this has the drawback that the failure is reported in the teardown rather than the test, and that test is reported twice: first as passed, and then as failed, e.g.: $ py.test-3 tests/mytest.py ============================================ test session starts ============================================ platform linux -- Python 3.4.2, pytest-2.8.7, py-1.4.31, pluggy-0.3.1 -- /usr/bin/python3 cachedir: tests/.cache rootdir: /home/nikratio/in-progress/s3ql/tests, inifile: pytest.ini plugins: catchlog-1.2.1 collected 1 items tests/mytest.py::test_log PASSED tests/mytest.py::test_log ERROR ================================================== ERRORS =================================================== _______________________________________ ERROR at teardown of test_log _______________________________________ Traceback (most recent call last): File "/home/nikratio/in-progress/s3ql/tests/conftest.py", line 48, in check_test_output raise AssertionError('Suspicious output to stderr') AssertionError: Suspicious output to stderr Best, -Nikolaus -- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F ?Time flies like an arrow, fruit flies like a Banana.? From holger at merlinux.eu Sat Mar 12 03:29:21 2016 From: holger at merlinux.eu (holger krekel) Date: Sat, 12 Mar 2016 09:29:21 +0100 Subject: [pytest-dev] sprint goal reached! Detail planning starts! Message-ID: <20160312082921.GH9114@uwanda> Hey all, good news. overnight we reached the sprint goal and are now at 103% :) This is thanks to Dolby Laboratories and Dropbox giving each >=1500 within a day. Thanks a lot! So i updated the sprint page to contain more organisational details. You can also add questions at the end. It's time to book travels! :) https://github.com/pytest-dev/pytest/wiki/sprint2016 Please fill in your details if you can until March 17th. Most important is planned arrival/depature and if you'd like to go for some shared accomodation space. I assume that those who are funded by their company book accomodation themselves but feel free to ask for help or share spaces there as well! Regarding accomodation a bit of background: It has been a little harder than i anticipated finding a good sprint place but i am confident something good works out, hopefully the "black forest hostel" which provides a big kitchen we can use and large hangout areas. Apart from the sprint room, they'll want us to not use laptops/mobiles too much in those community areas as they like people to not hide between screens -- in fact they don't provide WLAN in those areas :) best, holger From holger at merlinux.eu Sat Mar 12 07:31:18 2016 From: holger at merlinux.eu (Holger Krekel) Date: Sat, 12 Mar 2016 13:31:18 +0100 Subject: [pytest-dev] sprint goal reached! Detail planning starts! In-Reply-To: <20160312082921.GH9114@uwanda> References: <20160312082921.GH9114@uwanda> Message-ID: <1807EACA-5AFE-4DFE-857D-45A4CAB77BBD@merlinux.eu> And if anyone has ideas for stretch goals, shoot. H. On March 12, 2016 9:29:21 AM GMT+01:00, holger krekel wrote: >Hey all, > >good news. overnight we reached the sprint goal and are now at 103% :) >This is thanks to Dolby Laboratories and Dropbox giving each >=1500 >within a day. Thanks a lot! > >So i updated the sprint page to contain more organisational details. >You can also add questions at the end. > >It's time to book travels! :) > > https://github.com/pytest-dev/pytest/wiki/sprint2016 > >Please fill in your details if you can until March 17th. >Most important is planned arrival/depature and if you'd >like to go for some shared accomodation space. I assume >that those who are funded by their company book accomodation >themselves but feel free to ask for help or share spaces >there as well! > >Regarding accomodation a bit of background: It has been a little harder >than i anticipated finding a good sprint place but i am confident >something good works out, hopefully the "black forest hostel" which >provides a big kitchen we can use and large hangout areas. Apart from >the sprint room, they'll want us to not use laptops/mobiles too much in >those community areas as they like people to not hide between screens >-- >in fact they don't provide WLAN in those areas :) > >best, >holger > >_______________________________________________ >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 alexamici at gmail.com Mon Mar 14 14:59:41 2016 From: alexamici at gmail.com (Alessandro Amici) Date: Mon, 14 Mar 2016 18:59:41 +0000 Subject: [pytest-dev] How can I programmatically add a fixture to a test Message-ID: All, TL;DR - How do I programmatically (e.g. inside pytest_generate_tests) wrap a test function with a wrapper function that accept an additional fixture? Very long version I was on the verge to release version 1.0 of the pytest-nodev plugin [1] that enable test-driven search via a fixture or via a decorator, when I noticed that I could use the marker interface as a much nicer API, but I couldn't figure out the last bit I need. The context Following the example in the README assume I need to write a `parse_bool` function that robustly parses a boolean value from a string. Here is the test I intend to use to validate my own implementation once I write it: def test_parse_bool(): assert not parse_bool('false') assert not parse_bool('FALSE') assert not parse_bool('0') assert parse_bool('true') assert parse_bool('TRUE') assert parse_bool('1') I can "instrument" the test to use with pytest-nodev in two ways, first using the"wish" fixture explicitly: def test_parse_bool(wish): # <- here... parse_bool = wish # <- ... and here assert not parse_bool('false') assert not parse_bool('FALSE') assert not parse_bool('0') assert parse_bool('true') assert parse_bool('TRUE') assert parse_bool('1') the search is the executed with: py.test test_parse_bool.py --wish-from-stdlib The test is run once for every function found in the standard library and the functions that make the test pass (the little gem that is distutils.util:strtobool) is presented in the result summary. This is working right now, but the user needs to modify its test in a non trivial way. For the curious I parametrize the metafunc inside pytest_generate_tests [2]. So I'm experimenting with a following decorator interface: import pytest_nodev @pytest_nodev.search('parse_bool') def test_parse_bool(): assert not parse_bool('false') assert not parse_bool('FALSE') assert not parse_bool('0') assert parse_bool('true') assert parse_bool('TRUE') assert parse_bool('1') The "search" decorator takes the name of the tested object and uses the "monkeypatch" fixture together with the "wish" fixture to have the same result as above. This works right now and it is much easier for the users. The implementation is more complex though [3]. This is still not perfect because you still need to prepare the test specifically to be used for a search with pytest_nodev. The best approach would be to use a marker: import pytest @pytest.mark.target('parse_bool') def test_parse_bool(): assert not parse_bool('false') assert not parse_bool('FALSE') assert not parse_bool('0') assert parse_bool('true') assert parse_bool('TRUE') assert parse_bool('1') The marker is a nice documentation and can be left even when pytest-nodev is not installed. The problem is I didn't find a way to use the marker to monkeypatch and parametrize the test. This is the closest I could get: def pytest_generate_tests(metafunc): search_marker = getattr(metafunc.function, 'search', None) if not search_marker: return # setup the free variables for the wrapper closure target_name = search_marker.args[0] test_func = metafunc.function def wrapper(wish, monkeypatch): monkeypatch.setattr(target_name, wish) return test_func() # trying to make a hand-made test decorator metafunc.function = wrapper ids, params = make_wish_index(metafunc.config) metafunc.parametrize('wish', params, ids=ids, scope='module') But this dies with: pytest_nodev/plugin.py:134: in pytest_generate_tests metafunc.parametrize('wish', params, ids=ids, scope='module') ../mac-cpython3/lib/python3.5/site-packages/_pytest/python.py:1000: in parametrize raise ValueError("%r uses no fixture %r" %(self.function, arg)) E ValueError: .wrapper at 0x1064b7400> uses no fixture 'wish' Obviously I didn't manage to simulate [2] inside the pytest_generate_tests. I guess that I need to tell the metafunc that the function now use the wish and the monkeypatch fixtures. So my question is: can I programmatically simulate adding a decorator with arbitrary fixtures to a test? Is there a better way to do it? I understand the use case is complex and in case anybody is willing to help I'll do my best to ease their work, like creating a dedicated branch in the github repo. Thanks, Alessandro [1]. https://github.com/nodev-io/pytest-nodev [2]. https://github.com/nodev-io/pytest-nodev/blob/master/pytest_nodev/plugin.py#L121 [3]. https://github.com/nodev-io/pytest-nodev/blob/master/pytest_nodev/__init__.py#L12 -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Mon Mar 14 16:42:14 2016 From: holger at merlinux.eu (holger krekel) Date: Mon, 14 Mar 2016 21:42:14 +0100 Subject: [pytest-dev] sprint goal reached! Detail planning starts! In-Reply-To: <20160312082921.GH9114@uwanda> References: <20160312082921.GH9114@uwanda> Message-ID: <20160314204214.GB9114@uwanda> Hi again, small update regarding sprint location and a reminder for you to fill in your current plans/intentions wrt to the sprint here: https://github.com/pytest-dev/pytest/wiki/sprint2016 Today i heart that the black forest hostel is having troubles wrt to some reconstruction, prep works and that it likely not work out to do the sprint there which is a pity as it was my primary choice. I have two other concrete options that i am pursuing this week. One is very central but a bit small (34 square meters) and one is bigger but slightly on the outskirts (but very nice at the edge of forest). Namely, the 34qm one is "Ludwigstraase A" here: http://www.katholische-akademie-freiburg.de/html/content/tagungsraeume.html and the bigger one (60qm) is "Raum Sonnenschein" here: http://haus-am-schoenberg.de/raumvermietung-in-freiburg/ You can see them on this map: https://www.google.com/maps/d/edit?mid=z5JtngzIviVs.kr4aS2xjcX98&usp=sharing I am guessing it'd be nicer to hangout in the center and will visit the smaller place physically Friday morning. I somewhat know both sites already, they are both good in principle. Money wise they are both between 100-120 euros a day. best, holger On Sat, Mar 12, 2016 at 09:29 +0100, holger krekel wrote: > Hey all, > > good news. overnight we reached the sprint goal and are now at 103% :) > This is thanks to Dolby Laboratories and Dropbox giving each >=1500 > within a day. Thanks a lot! > > So i updated the sprint page to contain more organisational details. > You can also add questions at the end. > > It's time to book travels! :) > > https://github.com/pytest-dev/pytest/wiki/sprint2016 > > Please fill in your details if you can until March 17th. > Most important is planned arrival/depature and if you'd > like to go for some shared accomodation space. I assume > that those who are funded by their company book accomodation > themselves but feel free to ask for help or share spaces > there as well! > > Regarding accomodation a bit of background: It has been a little harder > than i anticipated finding a good sprint place but i am confident > something good works out, hopefully the "black forest hostel" which > provides a big kitchen we can use and large hangout areas. Apart from > the sprint room, they'll want us to not use laptops/mobiles too much in > those community areas as they like people to not hide between screens -- > in fact they don't provide WLAN in those areas :) > > best, > holger > > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev From alexamici at gmail.com Tue Mar 15 17:34:56 2016 From: alexamici at gmail.com (Alessandro Amici) Date: Tue, 15 Mar 2016 21:34:56 +0000 Subject: [pytest-dev] How can I programmatically add a fixture to a test In-Reply-To: References: Message-ID: All, apparently I can answer my own question. First of all, the `pytest_generate_tests` is the wrong place to replace the test function as the metafunc object is not really used outside of the method, only it's _calls attribute is. Then, after digging quite a bit into the source code, I found a may to manipulate the collected function before its arguments are extracted inside `pytest_pycollect_makeitem`. I'm working in this branch https://github.com/nodev-io/pytest-nodev/tree/marker-interface but what does the trick is the following: def pytest_pycollect_makeitem(collector, name, obj): search_marker = getattr(obj, 'search', None) if search_marker and getattr(search_marker, 'args', []): target_name = search_marker.args[0] def wrapper(wish, monkeypatch, *args, **kwargs): if '.' in target_name: monkeypatch.setattr(target_name, wish, raising=False) else: monkeypatch.setattr(inspect.getmodule(obj), target_name, wish, raising=False) return obj(*args, **kwargs) wrapper.__dict__ = obj.__dict__ return list(collector._genfunctions(name, wrapper)) With this the following two tests are equivalent: def test_parse_bool(wish): parse_bool = wish assert not parse_bool('false') [...] @pytest.mark.search('parse_bool') def test_parse_bool(): assert not parse_bool('false') [...] The way to programmatically add fixtures to a test function is to wrap it inside `pytest_pycollect_makeitem`. This is almost perfect, as with this method I can only wrap test function with no funcargs. Cheers, Alessandro On Mon, 14 Mar 2016 at 19:59 Alessandro Amici wrote: > All, > > TL;DR - How do I programmatically (e.g. inside pytest_generate_tests) wrap > a test function with a wrapper function that accept an additional fixture? > > Very long version > > I was on the verge to release version 1.0 of the pytest-nodev plugin [1] > that enable test-driven search via a fixture or via a decorator, when I > noticed that I could use the marker interface as a much nicer API, but I > couldn't figure out the last bit I need. > > The context > > Following the example in the README assume I need to write a `parse_bool` > function that robustly parses a boolean value from a string. Here is the > test I intend to use to validate my own implementation once I write it: > > def test_parse_bool(): > assert not parse_bool('false') > assert not parse_bool('FALSE') > assert not parse_bool('0') > assert parse_bool('true') > assert parse_bool('TRUE') > assert parse_bool('1') > > I can "instrument" the test to use with pytest-nodev in two ways, first > using the"wish" fixture explicitly: > > def test_parse_bool(wish): # <- here... > parse_bool = wish # <- ... and here > assert not parse_bool('false') > assert not parse_bool('FALSE') > assert not parse_bool('0') > assert parse_bool('true') > assert parse_bool('TRUE') > assert parse_bool('1') > > the search is the executed with: > > py.test test_parse_bool.py --wish-from-stdlib > > The test is run once for every function found in the standard library and > the functions that make the test pass (the little gem that > is distutils.util:strtobool) is presented in the result summary. > > This is working right now, but the user needs to modify its test in a non > trivial way. For the curious I parametrize the metafunc inside > pytest_generate_tests [2]. > > So I'm experimenting with a following decorator interface: > > import pytest_nodev > > @pytest_nodev.search('parse_bool') > def test_parse_bool(): > assert not parse_bool('false') > assert not parse_bool('FALSE') > assert not parse_bool('0') > assert parse_bool('true') > assert parse_bool('TRUE') > assert parse_bool('1') > > The "search" decorator takes the name of the tested object and uses the > "monkeypatch" fixture together with the "wish" fixture to have the same > result as above. This works right now and it is much easier for the users. > The implementation is more complex though [3]. > > This is still not perfect because you still need to prepare the test > specifically to be used for a search with pytest_nodev. > > The best approach would be to use a marker: > > import pytest > > @pytest.mark.target('parse_bool') > def test_parse_bool(): > assert not parse_bool('false') > assert not parse_bool('FALSE') > assert not parse_bool('0') > assert parse_bool('true') > assert parse_bool('TRUE') > assert parse_bool('1') > > The marker is a nice documentation and can be left even when pytest-nodev > is not installed. > > The problem is I didn't find a way to use the marker to monkeypatch and > parametrize the test. This is the closest I could get: > > def pytest_generate_tests(metafunc): > search_marker = getattr(metafunc.function, 'search', None) > if not search_marker: > return > > # setup the free variables for the wrapper closure > target_name = search_marker.args[0] > test_func = metafunc.function > > def wrapper(wish, monkeypatch): > monkeypatch.setattr(target_name, wish) > return test_func() > > # trying to make a hand-made test decorator > metafunc.function = wrapper > > ids, params = make_wish_index(metafunc.config) > metafunc.parametrize('wish', params, ids=ids, scope='module') > > But this dies with: > > pytest_nodev/plugin.py:134: in pytest_generate_tests > metafunc.parametrize('wish', params, ids=ids, scope='module') > ../mac-cpython3/lib/python3.5/site-packages/_pytest/python.py:1000: in > parametrize > raise ValueError("%r uses no fixture %r" %(self.function, arg)) > E ValueError: .wrapper at > 0x1064b7400> uses no fixture 'wish' > > Obviously I didn't manage to simulate [2] inside the > pytest_generate_tests. I guess that I need to tell the metafunc that the > function now use the wish and the monkeypatch fixtures. > > So my question is: can I programmatically simulate adding a decorator with > arbitrary fixtures to a test? Is there a better way to do it? > > I understand the use case is complex and in case anybody is willing to > help I'll do my best to ease their work, like creating a dedicated branch > in the github repo. > > Thanks, > Alessandro > > [1]. https://github.com/nodev-io/pytest-nodev > [2]. > https://github.com/nodev-io/pytest-nodev/blob/master/pytest_nodev/plugin.py#L121 > > [3]. > https://github.com/nodev-io/pytest-nodev/blob/master/pytest_nodev/__init__.py#L12 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpfannsc at redhat.com Wed Mar 16 11:15:38 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Wed, 16 Mar 2016 11:15:38 -0400 (EDT) Subject: [pytest-dev] Im going to attend the sprint In-Reply-To: <1886373948.67563215.1458141235288.JavaMail.zimbra@redhat.com> Message-ID: <1174318652.67565008.1458141338166.JavaMail.zimbra@redhat.com> Hi everyone, my employer is going to send me to the sprint :) -- Ronny From nicoddemus at gmail.com Wed Mar 16 11:32:48 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 16 Mar 2016 15:32:48 +0000 Subject: [pytest-dev] Im going to attend the sprint In-Reply-To: <1174318652.67565008.1458141338166.JavaMail.zimbra@redhat.com> References: <1886373948.67563215.1458141235288.JavaMail.zimbra@redhat.com> <1174318652.67565008.1458141338166.JavaMail.zimbra@redhat.com> Message-ID: Cool! :) On Wed, Mar 16, 2016 at 12:32 PM Ronny Pfannschmidt wrote: > Hi everyone, > > my employer is going to send me to the sprint :) > > -- Ronny > _______________________________________________ > 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 alexamici at gmail.com Wed Mar 16 12:19:51 2016 From: alexamici at gmail.com (Alessandro Amici) Date: Wed, 16 Mar 2016 16:19:51 +0000 Subject: [pytest-dev] pytest-nodev "test-driven code search" is in feature freeze Message-ID: All, I feel my plugin for searching python code using tests is ready for prime time, I invite interested parties to give it a spin. Feedback is very welcome, here of on the running "Show HN" page: https://news.ycombinator.com/item?id=11297137 This is how you get up and running: http://pytest-nodev.readthedocs.org/en/stable/quickstart.html Issues and contributions go here: https://github.com/nodev-io/pytest-nodev Please note that this is my first pytest plugin and I had some weird needs so I feel internals are not as nice as they could be. An expert eye or two reviewing my use of the plugin interface will be very, very appreciated: https://github.com/nodev-io/pytest-nodev/blob/master/pytest_nodev/plugin.py Thanks in advance, Alessandro -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Fri Mar 18 17:16:19 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Fri, 18 Mar 2016 21:16:19 +0000 Subject: [pytest-dev] Pytest 2.9.1 released Message-ID: Hi all, I'm happy to announce that pytest 2;9;1 has been released! This is a drop-in replacement for 2.9.0 containing just bug-fixes. As usual, you can upgrade from pypi via: pip install -U pytest See below for the changes and see docs at: http://pytest.org Thanks to all who contributed to this release, among them: Bruno Oliveira Daniel Hahler Dmitry Malinovsky Florian Bruhin Floris Bruynooghe Matt Bachmann Ronny Pfannschmidt TomV Vladimir Bolshakov Zearin palaviv Happy testing, The py.test Development Team 2.9.1 (compared to 2.9.0) ------------------------- **Bug Fixes** * Improve error message when a plugin fails to load. Thanks `@nicoddemus`_ for the PR. * Fix (`#1178 `_): ``pytest.fail`` with non-ascii characters raises an internal pytest error. Thanks `@nicoddemus`_ for the PR. * Fix (`#469`_): junit parses report.nodeid incorrectly, when params IDs contain ``::``. Thanks `@tomviner`_ for the PR (`#1431`_). * Fix (`#578 `_): SyntaxErrors containing non-ascii lines at the point of failure generated an internal py.test error. Thanks `@asottile`_ for the report and `@nicoddemus`_ for the PR. * Fix (`#1437`_): When passing in a bytestring regex pattern to parameterize attempt to decode it as utf-8 ignoring errors. * Fix (`#649`_): parametrized test nodes cannot be specified to run on the command line. .. _#1437: https://github.com/pytest-dev/pytest/issues/1437 .. _#469: https://github.com/pytest-dev/pytest/issues/469 .. _#1431: https://github.com/pytest-dev/pytest/pull/1431 .. _#649: https://github.com/pytest-dev/pytest/issues/649 .. _ at asottile: https://github.com/asottile -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliver.schoenborn at gmail.com Sat Mar 19 22:26:11 2016 From: oliver.schoenborn at gmail.com (oliver) Date: Sat, 19 Mar 2016 22:26:11 -0400 Subject: [pytest-dev] where to announce nose2pytest Message-ID: I have created a script that enables conversion of nose.tools.assert_ function calls to raw assert statements. The project is at https://github.com/schollii/nose2pytest. Where would be a good place to post this so pytest users know about it? Thanks, -- 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 Sun Mar 20 07:47:03 2016 From: me at the-compiler.org (Florian Bruhin) Date: Sun, 20 Mar 2016 12:47:03 +0100 Subject: [pytest-dev] where to announce nose2pytest In-Reply-To: References: Message-ID: <20160320114702.GC11428@tonks> * oliver [2016-03-19 22:26:11 -0400]: > I have created a script that enables conversion of nose.tools.assert_ > function calls to raw assert statements. The project is at > https://github.com/schollii/nose2pytest. Where would be a good place to > post this so pytest users know about it? Thanks, This list, and/or the testing-in-python list, and/or the python-announce list. http://lists.idyll.org/listinfo/testing-in-python https://mail.python.org/mailman/listinfo/python-announce-list You might also want to move it to the pytest-dev organization? http://pytest.org/latest/contributing.html#submitting-plugins-to-pytest-dev 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 Tue Mar 22 04:57:51 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Tue, 22 Mar 2016 04:57:51 -0400 (EDT) Subject: [pytest-dev] Refactoring/fixing markers In-Reply-To: <499297861.72123516.1458636794427.JavaMail.zimbra@redhat.com> Message-ID: <1468652838.72124865.1458637071579.JavaMail.zimbra@redhat.com> Hi Everyone, the current marker implementation has a massive bugs/issues wrt application of markers "smearning" across class boundaries due to marker transfer (which is basically completely broken). In order to elevate the issue, i'd like to change how markers are viewed by test items, the idea is to completely remove them from the actual objects, except for pytestmark collections on modules/classes/functions items would then get a merged view of markers that apply to them without ever copying/changing the marker collections of the applying objects this would change the external interface for markers, thus requiring a major version (pytest-3.0) so i#d like to request a branch on the main repo expressing that intent. i'm planning to implement this in the next 1-2 weeks. -- Ronny From nicoddemus at gmail.com Tue Mar 22 06:51:29 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 22 Mar 2016 10:51:29 +0000 Subject: [pytest-dev] New Trove Classifier: "Framework :: Pytest" Message-ID: Hi all, A new Trove Classifier "Framework :: Pytest" has been added to PyPI[1] following a request I made some time ago[2]. With this users have another way to search for pytest plugins besides searching only for projects with "pytest-" prefix, which is great! Later on today I will update the official docs to mention this and update plugincompat[3] to also use this classifier to find plugins. I recommend all plugin authors to include this classifier in your ``setup.py`` and publish the change to PyPI. For those who don't know, you don't need to publish a new release to update the PyPI project page, you can just add the classifier to ``setup.py`` and execute ``python setup.py register``. :) Cheers, [1] https://pypi.python.org/pypi?%3Aaction=list_classifiers [2] https://github.com/pypa/warehouse/issues/542 [3] http://plugincompat.herokuapp.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Tue Mar 22 07:25:46 2016 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 22 Mar 2016 11:25:46 +0000 Subject: [pytest-dev] Refactoring/fixing markers In-Reply-To: <1468652838.72124865.1458637071579.JavaMail.zimbra@redhat.com> References: <499297861.72123516.1458636794427.JavaMail.zimbra@redhat.com> <1468652838.72124865.1458637071579.JavaMail.zimbra@redhat.com> Message-ID: Hi Ronny, That would be nice, I think it is OK to use a branch in the main repository. I wonder though if we can keep the same general interface though, but we can discuss this over the code once you have something in place. :) Cheers, On Tue, Mar 22, 2016 at 6:14 AM Ronny Pfannschmidt wrote: > Hi Everyone, > > the current marker implementation has a massive bugs/issues wrt > application of markers "smearning" across class boundaries > due to marker transfer (which is basically completely broken). > > In order to elevate the issue, i'd like to change how markers are viewed > by test items, > > the idea is to completely remove them from the actual objects, except for > pytestmark collections on modules/classes/functions > > items would then get a merged view of markers that apply to them without > ever copying/changing the marker collections of the applying objects > > this would change the external interface for markers, thus requiring a > major version (pytest-3.0) > so i#d like to request a branch on the main repo expressing that intent. > > > > i'm planning to implement this in the next 1-2 weeks. > > -- Ronny > _______________________________________________ > 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 Mar 22 08:24:11 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Tue, 22 Mar 2016 08:24:11 -0400 (EDT) Subject: [pytest-dev] Refactoring/fixing markers In-Reply-To: References: <499297861.72123516.1458636794427.JavaMail.zimbra@redhat.com> <1468652838.72124865.1458637071579.JavaMail.zimbra@redhat.com> Message-ID: <623759848.72258817.1458649451270.JavaMail.zimbra@redhat.com> Hi Bruno, i intend to keep the external facade for usage the same, alsi i want to keep the api on items however i intend to break the api on the concrete objects -- Ronny ----- Original Message ----- From: "Bruno Oliveira" To: "Ronny Pfannschmidt" , pytest-dev at python.org Sent: Tuesday, March 22, 2016 12:25:46 PM Subject: Re: [pytest-dev] Refactoring/fixing markers Hi Ronny, That would be nice, I think it is OK to use a branch in the main repository. I wonder though if we can keep the same general interface though, but we can discuss this over the code once you have something in place. :) Cheers, On Tue, Mar 22, 2016 at 6:14 AM Ronny Pfannschmidt wrote: > Hi Everyone, > > the current marker implementation has a massive bugs/issues wrt > application of markers "smearning" across class boundaries > due to marker transfer (which is basically completely broken). > > In order to elevate the issue, i'd like to change how markers are viewed > by test items, > > the idea is to completely remove them from the actual objects, except for > pytestmark collections on modules/classes/functions > > items would then get a merged view of markers that apply to them without > ever copying/changing the marker collections of the applying objects > > this would change the external interface for markers, thus requiring a > major version (pytest-3.0) > so i#d like to request a branch on the main repo expressing that intent. > > > > i'm planning to implement this in the next 1-2 weeks. > > -- Ronny > _______________________________________________ > pytest-dev mailing list > pytest-dev at python.org > https://mail.python.org/mailman/listinfo/pytest-dev > From holger at merlinux.eu Tue Mar 22 10:58:47 2016 From: holger at merlinux.eu (Holger Krekel) Date: Tue, 22 Mar 2016 15:58:47 +0100 Subject: [pytest-dev] Refactoring/fixing markers In-Reply-To: References: <499297861.72123516.1458636794427.JavaMail.zimbra@redhat.com> <1468652838.72124865.1458637071579.JavaMail.zimbra@redhat.com> Message-ID: <41A01B5A-3943-4C4D-8DA4-D96F492E9194@merlinux.eu> Iiuc you want to remove the setting of marker objects on function objects, right? If so, Why is doing that necessary? Best holger On March 22, 2016 12:25:46 PM GMT+01:00, Bruno Oliveira wrote: >Hi Ronny, > >That would be nice, I think it is OK to use a branch in the main >repository. > >I wonder though if we can keep the same general interface though, but >we >can discuss this over the code once you have something in place. :) > >Cheers, > >On Tue, Mar 22, 2016 at 6:14 AM Ronny Pfannschmidt > >wrote: > >> Hi Everyone, >> >> the current marker implementation has a massive bugs/issues wrt >> application of markers "smearning" across class boundaries >> due to marker transfer (which is basically completely broken). >> >> In order to elevate the issue, i'd like to change how markers are >viewed >> by test items, >> >> the idea is to completely remove them from the actual objects, except >for >> pytestmark collections on modules/classes/functions >> >> items would then get a merged view of markers that apply to them >without >> ever copying/changing the marker collections of the applying objects >> >> this would change the external interface for markers, thus requiring >a >> major version (pytest-3.0) >> so i#d like to request a branch on the main repo expressing that >intent. >> >> >> >> i'm planning to implement this in the next 1-2 weeks. >> >> -- Ronny >> _______________________________________________ >> 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 rpfannsc at redhat.com Tue Mar 22 11:16:48 2016 From: rpfannsc at redhat.com (Ronny Pfannschmidt) Date: Tue, 22 Mar 2016 16:16:48 +0100 Subject: [pytest-dev] Refactoring/fixing markers In-Reply-To: <41A01B5A-3943-4C4D-8DA4-D96F492E9194@merlinux.eu> References: <499297861.72123516.1458636794427.JavaMail.zimbra@redhat.com> <1468652838.72124865.1458637071579.JavaMail.zimbra@redhat.com> <41A01B5A-3943-4C4D-8DA4-D96F492E9194@merlinux.eu> Message-ID: <56F161E0.8060102@redhat.com> On 03/22/2016 03:58 PM, Holger Krekel wrote: > Iiuc you want to remove the setting of marker objects on function > objects, right? If so, Why is doing that necessary? correct, from my pov its very hard to make a consistent transfered view of them on the actual objects so we either make a mess that's complex and potentially inconsistent or take it out and expose it only via collection items where a consistent view based on the chain is simple and straightforward i strongly prefer taking unnecessary complexities out best Ronny > Best holger > > On March 22, 2016 12:25:46 PM GMT+01:00, Bruno Oliveira > wrote: > > Hi Ronny, > > That would be nice, I think it is OK to use a branch in the main > repository. > > I wonder though if we can keep the same general interface though, > but we can discuss this over the code once you have something in > place. :) > > Cheers, > > On Tue, Mar 22, 2016 at 6:14 AM Ronny Pfannschmidt > > wrote: > > Hi Everyone, > > the current marker implementation has a massive bugs/issues > wrt application of markers "smearning" across class boundaries > due to marker transfer (which is basically completely broken). > > In order to elevate the issue, i'd like to change how markers > are viewed by test items, > > the idea is to completely remove them from the actual objects, > except for pytestmark collections on modules/classes/functions > > items would then get a merged view of markers that apply to > them without ever copying/changing the marker collections of > the applying objects > > this would change the external interface for markers, thus > requiring a major version (pytest-3.0) > so i#d like to request a branch on the main repo expressing > that intent. > > > > i'm planning to implement this in the next 1-2 weeks. > > -- Ronny > _______________________________________________ > 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 holger at merlinux.eu Tue Mar 22 11:34:47 2016 From: holger at merlinux.eu (Holger Krekel) Date: Tue, 22 Mar 2016 16:34:47 +0100 Subject: [pytest-dev] Refactoring/fixing markers In-Reply-To: <56F161E0.8060102@redhat.com> References: <499297861.72123516.1458636794427.JavaMail.zimbra@redhat.com> <1468652838.72124865.1458637071579.JavaMail.zimbra@redhat.com> <41A01B5A-3943-4C4D-8DA4-D96F492E9194@merlinux.eu> <56F161E0.8060102@redhat.com> Message-ID: <8EFD258C-F282-4A5D-9630-B24B762CC111@merlinux.eu> I can see how maintaining backward compatibility makes the implementation more complex but breaking compatibility introduces social, communication complexities and surprises on the usage side because suddenly marker detection will silently not work anymore. So it needs to be carefully weighed. Best holger On March 22, 2016 4:16:48 PM GMT+01:00, Ronny Pfannschmidt wrote: >On 03/22/2016 03:58 PM, Holger Krekel wrote: >> Iiuc you want to remove the setting of marker objects on function >> objects, right? If so, Why is doing that necessary? >correct, from my pov its very hard to make a consistent transfered view >of them on the actual objects >so we either make a mess that's complex and potentially inconsistent or >take it out >and expose it only via collection items where a consistent view based >on >the chain is simple and straightforward > >i strongly prefer taking unnecessary complexities out > >best Ronny >> Best holger >> >> On March 22, 2016 12:25:46 PM GMT+01:00, Bruno Oliveira >> wrote: >> >> Hi Ronny, >> >> That would be nice, I think it is OK to use a branch in the main >> repository. >> >> I wonder though if we can keep the same general interface though, >> but we can discuss this over the code once you have something in >> place. :) >> >> Cheers, >> >> On Tue, Mar 22, 2016 at 6:14 AM Ronny Pfannschmidt >> > wrote: >> >> Hi Everyone, >> >> the current marker implementation has a massive bugs/issues >> wrt application of markers "smearning" across class >boundaries >> due to marker transfer (which is basically completely >broken). >> >> In order to elevate the issue, i'd like to change how markers >> are viewed by test items, >> >> the idea is to completely remove them from the actual >objects, >> except for pytestmark collections on >modules/classes/functions >> >> items would then get a merged view of markers that apply to >> them without ever copying/changing the marker collections of >> the applying objects >> >> this would change the external interface for markers, thus >> requiring a major version (pytest-3.0) >> so i#d like to request a branch on the main repo expressing >> that intent. >> >> >> >> i'm planning to implement this in the next 1-2 weeks. >> >> -- Ronny >> _______________________________________________ >> 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! -- Sent using mobile touch keys, increased chances for errors and misunderstandings. Enjoy! From oliver.schoenborn at gmail.com Fri Mar 25 19:05:30 2016 From: oliver.schoenborn at gmail.com (oliver) Date: Fri, 25 Mar 2016 19:05:30 -0400 Subject: [pytest-dev] where to announce nose2pytest In-Reply-To: <20160320114702.GC11428@tonks> References: <20160320114702.GC11428@tonks> Message-ID: Thx Florian for the tips. I have finally gotten around to releasing on pypi so I'll post to those places you suggested. Cheers, Oliver On Mar 20, 2016 7:52 AM, "Florian Bruhin" wrote: > * oliver [2016-03-19 22:26:11 -0400]: > > I have created a script that enables conversion of nose.tools.assert_ > > function calls to raw assert statements. The project is at > > https://github.com/schollii/nose2pytest. Where would be a good place to > > post this so pytest users know about it? Thanks, > > This list, and/or the testing-in-python list, and/or the > python-announce list. > > http://lists.idyll.org/listinfo/testing-in-python > https://mail.python.org/mailman/listinfo/python-announce-list > > You might also want to move it to the pytest-dev organization? > http://pytest.org/latest/contributing.html#submitting-plugins-to-pytest-dev > > 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 sivan at vitakka.co Sun Mar 27 10:23:33 2016 From: sivan at vitakka.co (Sivan Greenberg) Date: Sun, 27 Mar 2016 17:23:33 +0300 Subject: [pytest-dev] pytest sprint Message-ID: Hi All, I'm really interested in the sprint! specifically in contributing to a standardized server testing fixture as I miss the ability to configure a full www-root structure with pytest-localserver and pytest-server-fixtures seems broken through pip (but I did not investigate too deep to confirm this is not just in my setup ;)). And indeed, the fixture system in general needs more helpb to be understandable. Also, as I'm using pytest to test PyQt based mechanized browsers, I'd love to see what work needs to be done to have something around that standardized as well - namely, QApplication setup and teardown (modulescope breaks its) and anything I can help off the list of items to work on from the list. 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). Many thanks, (and thanks for pytest!) -Sivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Sun Mar 27 12:39:50 2016 From: me at the-compiler.org (Florian Bruhin) Date: Sun, 27 Mar 2016 18:39:50 +0200 Subject: [pytest-dev] pytest sprint In-Reply-To: References: Message-ID: <20160327163950.GO11428@tonks> Hey Sivan, * Sivan Greenberg [2016-03-27 17:23:33 +0300]: > Also, as I'm using pytest to test PyQt based mechanized browsers, I'd love > to see what work needs to be done to have something around that > standardized as well - namely, QApplication setup and teardown (modulescope > breaks its) and anything I can help off the list of items to work on from > the list. Oh, interesting! Do you have a link? I use pytest to test qutebrowser[1], which is my PyQt-based browser, so I'd be really interested in seeing how you approached this :) Have you seen pytest-qt[2]? [1] http://www.qutebrowser.org/ [2] https://github.com/pytest-dev/pytest-qt > 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). There is a Freiburg/Fribourg in Switzerland, but that's *not* where the sprint is. It's in "Freiburg im Breisgau" in the black forest (Schwarzwald) in southern Germany. However, swiss airports (Basel/Zurich) might be a good point to fly to and then take a train. Another possibility is flying to Frankfurt or Stuttgart and taking the train from there. Can you please add yourself to the sprints page?[3] However, the original deadline for this was 10 days ago, so I'm not sure how the planning is going on currently - Holger will have to comment on that. [3] https://github.com/pytest-dev/pytest/wiki/sprint2016 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 holger at merlinux.eu Sun Mar 27 14:27:54 2016 From: holger at merlinux.eu (holger krekel) Date: Sun, 27 Mar 2016 20:27:54 +0200 Subject: [pytest-dev] pytest sprint In-Reply-To: <20160327163950.GO11428@tonks> References: <20160327163950.GO11428@tonks> Message-ID: <20160327182754.GI3763@uwanda> Hi Sivan, all, On Sun, Mar 27, 2016 at 18:39 +0200, Florian Bruhin wrote: > Hey Sivan, > > * Sivan Greenberg [2016-03-27 17:23:33 +0300]: > > Also, as I'm using pytest to test PyQt based mechanized browsers, I'd love > > to see what work needs to be done to have something around that > > standardized as well - namely, QApplication setup and teardown (modulescope > > breaks its) and anything I can help off the list of items to work on from > > the list. > > Oh, interesting! Do you have a link? I use pytest to test > qutebrowser[1], which is my PyQt-based browser, so I'd be really > interested in seeing how you approached this :) > > Have you seen pytest-qt[2]? > > [1] http://www.qutebrowser.org/ > [2] https://github.com/pytest-dev/pytest-qt > > > 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? 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. > There is a Freiburg/Fribourg in Switzerland, but that's *not* where > the sprint is. It's in "Freiburg im Breisgau" in the black forest > (Schwarzwald) in southern Germany. > > However, swiss airports (Basel/Zurich) might be a good point to fly to > and then take a train. Another possibility is flying to Frankfurt or > Stuttgart and taking the train from there. > > Can you please add yourself to the sprints page?[3] However, the > original deadline for this was 10 days ago, so I'm not sure how the > planning is going on currently - Holger will have to comment on that. > [3] https://github.com/pytest-dev/pytest/wiki/sprint2016 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. holger From sivan at vitakka.co Tue Mar 29 04:59:48 2016 From: sivan at vitakka.co (Sivan Greenberg) Date: Tue, 29 Mar 2016 11:59:48 +0300 Subject: [pytest-dev] pytest sprint In-Reply-To: <20160327163950.GO11428@tonks> References: <20160327163950.GO11428@tonks> Message-ID: Hi Florian, Could we have met in the past during aKademy or Qt Summit ? Your nick & name ring familiar. On Sun, Mar 27, 2016 at 7:39 PM, Florian Bruhin wrote: > Oh, interesting! Do you have a link? I use pytest to test > qutebrowser[1], which is my PyQt-based browser, so I'd be really > interested in seeing how you approached this :) > > I'm mostly just starting out, being an avid user of pyunit , moving to pytest to test PyQt5 I had to get rid of a module scoped QApplication as this caused crashes for some reason, and now I'm wrapping QApplication inside the namespace of the tested object, to overcome the unexpected asynchronous event driven nature of a QtWebKit as so : class MechBrowser(QApplication): myobj = None scenario = None result = None def __init__(self, buf): QApplication.__init__(self, sys.argv) self.myobj = MyObj() self.scenario = json.loads(buf)i self.myobj.loadFInished.connect(self.finished) QTimer.singeShot(0, self.run_scenario) self.exec_() def finished(self, data): self.result = json.dumps(data, indent=True) self.exit() def run_scenario(self): self.myobj.execute_scenario(self.scenario) > Have you seen pytest-qt[2]? > > I haven't! Thanks much for pointing it out, it could have made things much easier and quicker for me as it seems, I wonder if it needs T&L that the sprint could provide it :) QuteBrowser seems cool as well, but haven't had a chance to test it, maybe today! > > There is a Freiburg/Fribourg in Switzerland, but that's *not* where > the sprint is. It's in "Freiburg im Breisgau" in the black forest > (Schwarzwald) in southern Germany. > > I've heard nice stories about the black forest, there's even a cake by that name right? > However, swiss airports (Basel/Zurich) might be a good point to fly to > and then take a train. Another possibility is flying to Frankfurt or > Stuttgart and taking the train from there. > > Frankfurt AP is like second home to me, that seems the probable plan. P.S, Sorry for delayed response, didn't have a chance to attend to this until now.. -Sivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sivan at vitakka.co Tue Mar 29 05:17:51 2016 From: sivan at vitakka.co (Sivan Greenberg) Date: Tue, 29 Mar 2016 12:17:51 +0300 Subject: [pytest-dev] pytest sprint In-Reply-To: <20160327182754.GI3763@uwanda> References: <20160327163950.GO11428@tonks> <20160327182754.GI3763@uwanda> Message-ID: 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.rajanikanthreddy at gmail.com Wed Mar 30 02:19:57 2016 From: m.rajanikanthreddy at gmail.com (M.Rajani Kanth Reddy) Date: Wed, 30 Mar 2016 11:49:57 +0530 Subject: [pytest-dev] Does pytest support IronPython ? Message-ID: Hi All, The documentation of pytest says "runs on Posix/Windows, Python 2.6-3.5, PyPy and (possibly still) Jython-2.5.1". It didn't mention about usage of pytest in IronPython environment. Do you have any documentation on usage of pytest in .Net or C# using IronPython. Or, what is the best way to make use of C# and .NET platform libraries in Python and PyTest. Any pointers on this topic is highly appreciated. Regards, M.RajaniKanth Reddy Bangalore, India. -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Wed Mar 30 02:42:18 2016 From: me at the-compiler.org (Florian Bruhin) Date: Wed, 30 Mar 2016 08:42:18 +0200 Subject: [pytest-dev] Does pytest support IronPython ? In-Reply-To: References: Message-ID: <20160330064218.GG25141@tonks> * M.Rajani Kanth Reddy [2016-03-30 11:49:57 +0530]: > The documentation of pytest says "runs on Posix/Windows, > Python 2.6-3.5, PyPy and (possibly still) Jython-2.5.1". It didn't mention > about usage of pytest in IronPython environment. > > Do you have any documentation on usage of pytest in .Net or C# using > IronPython. > > Or, what is the best way to make use of C# and .NET platform libraries in > Python and PyTest. > > Any pointers on this topic is highly appreciated. I guess nobody has ever tried, it might just work. 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 oliver.schoenborn at gmail.com Thu Mar 31 00:04:10 2016 From: oliver.schoenborn at gmail.com (oliver) Date: Thu, 31 Mar 2016 00:04:10 -0400 Subject: [pytest-dev] ANN: nose2pytest 1.0 Message-ID: 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. Regards, Oliver -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrickdepinguin at gmail.com Thu Mar 31 04:23:00 2016 From: patrickdepinguin at gmail.com (Thomas De Schampheleire) Date: Thu, 31 Mar 2016 10:23:00 +0200 Subject: [pytest-dev] ANN: nose2pytest 1.0 In-Reply-To: References: Message-ID: Hi Oliver, 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. > Being precisely in the process of migrating a nose-based application (Kallithea) to pytest, this sounds very interesting. With the help of a pytest-month initiative last April, we already became able of using pytest as the test runner, but the actual test cases had not been converted until recently. Now I am doing just that. However, our tests are not using assert methods of nose but of unittest, e.g. self.assertEqual, self.assertRaises, ... As a temporary measure, I implemented wrapper functions in our pytest base test class: # transitional implementations of unittest.TestCase asserts # Users of these should be converted to pytest's single 'assert' call def assertEqual(self, first, second, msg=None): assert first == second def assertNotEqual(self, first, second, msg=None): assert first != second def assertTrue(self, expr, msg=None): assert bool(expr) is True def assertFalse(self, expr, msg=None): assert bool(expr) is False def assertIn(self, first, second, msg=None): assert first in second def assertNotIn(self, first, second, msg=None): assert first not in second def assertSetEqual(self, first, second, msg=None): assert first == second def assertListEqual(self, first, second, msg=None): assert first == second def assertDictEqual(self, first, second, msg=None): assert first == second def assertRaises(self, exception, method): with pytest.raises(exception): method() 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? Aside from the assert functions, another type of conversion I had to make was from unittest-style setUp/tearDown functions to pytest-style: setUp(self) --> setup_method(self, method) tearDown(self) --> teardown_method(self, method) setUpClass(cls) --> setup_class(cls) __init__(self, ...) --> setup_class(cls) ... While your README mentions that some replacement can be done with simple search/replace, I think it would be most useful if even such things were handled by nose2pytest, so that it becomes a one-stop solution. Looking forward to your feedback, Thomas From me at the-compiler.org Thu Mar 31 04:36:31 2016 From: me at the-compiler.org (Florian Bruhin) Date: Thu, 31 Mar 2016 10:36:31 +0200 Subject: [pytest-dev] Converting unittest to pytest (was: Re: ANN: nose2pytest 1.0) In-Reply-To: References: Message-ID: <20160331083631.GO25141@tonks> 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 > Aside from the assert functions, another type of conversion I had to > make was from unittest-style setUp/tearDown functions to pytest-style: > > setUp(self) --> setup_method(self, method) > tearDown(self) --> teardown_method(self, method) > setUpClass(cls) --> setup_class(cls) > __init__(self, ...) --> setup_class(cls) > ... > > While your README mentions that some replacement can be done with > simple search/replace, I think it would be most useful if even such > things were handled by nose2pytest, so that it becomes a one-stop > solution. I don't think unittest2pytest (either one) handles that, but I'm not sure. Let's just not create a third one please :D 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: