From nicoddemus at gmail.com Tue Aug 1 15:40:32 2017 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 01 Aug 2017 22:40:32 +0000 Subject: [TIP] pytest 3.2.0 released Message-ID: The pytest team is proud to announce the 3.2.0 release! pytest is a mature Python testing tool with more than a 1600 tests against itself, passing on many different interpreters and platforms. This release contains a number of bugs fixes and improvements, so users are encouraged to take a look at the CHANGELOG: http://doc.pytest.org/en/latest/changelog.html For complete documentation, please visit: http://docs.pytest.org As usual, you can upgrade from pypi via: pip install -U pytest Thanks to all who contributed to this release, among them: * Alex Hartoto * Andras Tim * Bruno Oliveira * Daniel Hahler * Florian Bruhin * Floris Bruynooghe * John Still * Jordan Moldow * Kale Kundert * Lawrence Mitchell * Llandy Riveron Del Risco * Maik Figura * Martin Altmayer * Mihai Capot? * Nathaniel Waisbrot * Nguy?n H?ng Qu?n * Pauli Virtanen * Raphael Pierzina * Ronny Pfannschmidt * Segev Finer * V.Kuznetsov Happy testing, The Pytest Development Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From arunsep886 at gmail.com Wed Aug 23 11:12:39 2017 From: arunsep886 at gmail.com (arun kali raja) Date: Wed, 23 Aug 2017 23:42:39 +0530 Subject: [TIP] REG: Passing custom parameters to pytest Message-ID: HI all.. My testcases 'may' need some dynamic variables that are passed during invocation.. I saw pytest-variables plugin that does something similar.. The only disadvantage it accepts only a file.. Doesnt accept a dictionary or json. So i was thinking i will have a pytest option to accept a dict or json (as string and then literal-eval). Once it is evaluated i can write it into a file and then pass that parameter into --variables . I was thinking of using the hook "pytest_cmdline_preparse" hook to do this data conversion . Though its working fine i see that this particular hook is marked as deprecated in the hookspec. Strangely "pytest_cmdline_parse" hook doesnt get called at all for me. What are the other hooks i can use to do this manipulation? Or is there a better way altogether to do this.. -- Regards Arun Kaliraja.B -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Wed Aug 23 13:33:57 2017 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 23 Aug 2017 20:33:57 +0000 Subject: [TIP] REG: Passing custom parameters to pytest In-Reply-To: References: Message-ID: Hi Arun, On Wed, Aug 23, 2017 at 3:15 PM arun kali raja wrote: > > So i was thinking i will have a pytest option to accept a dict or > json (as string and then literal-eval). > You mean passing a json or dict literal in the command line? If so it doesn't seem like a good idea, dicts/json will contain a lot of special characters that need to be shell-escaped. > Or is there a better way altogether to do this.. > What's wrong with passing the variables using a file? Cheers, Bruno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From arunsep886 at gmail.com Wed Aug 23 18:40:58 2017 From: arunsep886 at gmail.com (arun kali raja) Date: Thu, 24 Aug 2017 07:10:58 +0530 Subject: [TIP] REG: Passing custom parameters to pytest In-Reply-To: References: Message-ID: I am using jenkins-like tool for doing CI and i will have jobs for each release.. So instead of having a text file, if the variables are mentioned in the invocation then it's easy for users to use it... On 24-Aug-2017 2:04 AM, "Bruno Oliveira" wrote: > Hi Arun, > > On Wed, Aug 23, 2017 at 3:15 PM arun kali raja > wrote: > >> >> So i was thinking i will have a pytest option to accept a dict or >> json (as string and then literal-eval). >> > > You mean passing a json or dict literal in the command line? If so it > doesn't seem like a good idea, dicts/json will contain a lot of special > characters that need to be shell-escaped. > > >> Or is there a better way altogether to do this.. >> > > What's wrong with passing the variables using a file? > > Cheers, > Bruno. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Wed Aug 23 18:50:39 2017 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Thu, 24 Aug 2017 01:50:39 +0000 Subject: [TIP] REG: Passing custom parameters to pytest In-Reply-To: References: Message-ID: On Wed, Aug 23, 2017 at 10:41 PM arun kali raja wrote: > I am using jenkins-like tool for doing CI and i will have jobs for each > release.. > > So instead of having a text file, if the variables are mentioned in the > invocation then it's easy for users to use it... > As a workaround to your original question, realize you can write a file just as easily as passing an argument to something: $ pytest --variables-on-cmdline=[[JSON_CONTENTS]] can become: $ echo [[JSON_CONTENTS]] > input.json $ pytest --variables=input.json But keep in mind this will need careful and complex shell escaping. I'm sure there is a better ways to accomplish this if you would explain your use case in more details. Cheers, > On 24-Aug-2017 2:04 AM, "Bruno Oliveira" wrote: > >> Hi Arun, >> >> On Wed, Aug 23, 2017 at 3:15 PM arun kali raja >> wrote: >> >>> >>> So i was thinking i will have a pytest option to accept a dict or >>> json (as string and then literal-eval). >>> >> >> You mean passing a json or dict literal in the command line? If so it >> doesn't seem like a good idea, dicts/json will contain a lot of special >> characters that need to be shell-escaped. >> >> >>> Or is there a better way altogether to do this.. >>> >> >> What's wrong with passing the variables using a file? >> >> Cheers, >> Bruno. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: