From ran at unusedvar.com Sat Oct 3 15:57:55 2020 From: ran at unusedvar.com (Ran Benita) Date: Sat, 03 Oct 2020 22:57:55 +0300 Subject: [pytest-dev] pytest-6.1.1 Message-ID: <4796b28c-31d9-4a6d-9dd9-7c45c3252067@www.fastmail.com> pytest 6.1.1 has just been released to PyPI. This is a bug-fix release, being a drop-in replacement. To upgrade:: pip install --upgrade pytest The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. Thanks to all of the contributors to this release: * Ran Benita Happy testing, The pytest Development Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From variedthoughts at gmail.com Tue Oct 6 12:55:20 2020 From: variedthoughts at gmail.com (Brian Okken) Date: Tue, 6 Oct 2020 09:55:20 -0700 Subject: [pytest-dev] How do plugins support multiple pytest versions? Message-ID: Hi, How do plugins support multiple pytest versions when the hook api changes? Or should they? Example. pytest-json-report ytest_warning_captured, which was deprecated in pytest 6. Looks like there's a new hook, pytest_warning_recorded, with similar enough API. I haven't tested it to see if the behavior is close enough to work as a drop in replacement. But even if it is, switching to the new api makes the plugin only work on pytest 6.0 and above. Is it recommended that plugin authors try to force users to always use the latest pytest? What if they want to support older versions also? Is there a recommended way to say this? if pytest version < 6, use one hook else use new hook Thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicoddemus at gmail.com Tue Oct 6 13:07:03 2020 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Tue, 6 Oct 2020 14:07:03 -0300 Subject: [pytest-dev] How do plugins support multiple pytest versions? In-Reply-To: References: Message-ID: Hey Brian, On Tue, Oct 6, 2020 at 1:55 PM Brian Okken wrote: > Hi, > > How do plugins support multiple pytest versions when the hook api changes? > Or should they? > > Example. > pytest-json-report ytest_warning_captured, which was deprecated in pytest > 6. > Looks like there's a new hook, pytest_warning_recorded, with similar > enough API. > I haven't tested it to see if the behavior is close enough to work as a > drop in replacement. > > But even if it is, switching to the new api makes the plugin only work on > pytest 6.0 and above. > > Is it recommended that plugin authors try to force users to always use the > latest pytest? > What if they want to support older versions also? > > Is there a recommended way to say this? > > if pytest version < 6, use one hook > else use new hook > > I believe it really depends on the plugin and how many users you have. Certainly only supporting the latest pytest version is easier, but if you must support older versions, then checking the version to decide which hooks to implement is doable. An alternative is to check if the new hook exists, like how we used to do in pytest-xdist: https://github.com/pytest-dev/pytest-xdist/blob/7bf654775dcd2fef9c0ebafbea982b7d180b740e/src/xdist/remote.py#L142-L164 Where we implement one hook or the other, giving preference to the new hook when available. Cheers, Bruno. > > Thanks, > Brian > _______________________________________________ > 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 variedthoughts at gmail.com Tue Oct 6 13:28:20 2020 From: variedthoughts at gmail.com (Brian Okken) Date: Tue, 6 Oct 2020 10:28:20 -0700 Subject: [pytest-dev] How do plugins support multiple pytest versions? In-Reply-To: References: Message-ID: <5EE57B53-C855-4297-BBD0-79302E586667@gmail.com> Bruno, Thanks for the great and rapid info. - Brian > On Oct 6, 2020, at 10:07 AM, Bruno Oliveira wrote: > > ? > Hey Brian, > > >> On Tue, Oct 6, 2020 at 1:55 PM Brian Okken wrote: >> Hi, >> >> How do plugins support multiple pytest versions when the hook api changes? >> Or should they? >> >> Example. >> pytest-json-report ytest_warning_captured, which was deprecated in pytest 6. >> Looks like there's a new hook, pytest_warning_recorded, with similar enough API. >> I haven't tested it to see if the behavior is close enough to work as a drop in replacement. >> >> But even if it is, switching to the new api makes the plugin only work on pytest 6.0 and above. >> >> Is it recommended that plugin authors try to force users to always use the latest pytest? >> What if they want to support older versions also? >> >> Is there a recommended way to say this? >> >> if pytest version < 6, use one hook >> else use new hook > > I believe it really depends on the plugin and how many users you have. Certainly only supporting the latest pytest version is easier, > but if you must support older versions, then checking the version to decide which hooks to implement is doable. > > An alternative is to check if the new hook exists, like how we used to do in pytest-xdist: > > https://github.com/pytest-dev/pytest-xdist/blob/7bf654775dcd2fef9c0ebafbea982b7d180b740e/src/xdist/remote.py#L142-L164 > > Where we implement one hook or the other, giving preference to the new hook when available. > > Cheers, > Bruno. > > >> >> Thanks, >> Brian >> _______________________________________________ >> 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 Wed Oct 28 13:24:41 2020 From: nicoddemus at gmail.com (Bruno Oliveira) Date: Wed, 28 Oct 2020 14:24:41 -0300 Subject: [pytest-dev] pytest 6.1.2 released Message-ID: pytest 6.1.2 has just been released to PyPI. This is a bug-fix release, being a drop-in replacement. To upgrade:: pip install --upgrade pytest The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. Thanks to all of the contributors to this release: * Bruno Oliveira * Manuel Mari?ez * Ran Benita * Vasilis Gerakaris * William Jamir Silva Happy testing, The pytest Development Team -------------- next part -------------- An HTML attachment was scrubbed... URL: