-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__multicall__ being deprecated in upcoming pytest release #3
Comments
I'm thinking about fixing this separately from #7 as I really want to switch to pytest 2.8 without getting warnings 😉 @eisensheng Would you do a new release for me if I fixed this? |
@The-Compiler Sorry for delaying this show stopper. I've stripped out any API-breaking changes from the PR recently, but have not pushed yet because of few failing tests. Is it OK for you? |
Ah, awesome! Sounds good to me. Probably makes sense to move the API/LineMatcher changes to a separate PR anyways as they might take a little bit more time/discussion. Thanks for all your work on catchlog, I really appreciate it! |
Too bad. I was all in favour for the API break. We could simply release 1.2 with the feature to pull configuration from the cfg file and a fix for This would also be the safest upgrade path for current users of the original plugin and this fork. (If there are any users of this fork that is …) |
That doesn't mean that I've thrown all that changes into to a trashcan ♻️ |
Take advantage of `@pytest.mark.hookwrapper` facility and use more idiomatic pytest_runtest_call(item) hook for performing capturing (in fact, the same is used by the core 'pytest.capture' module). Instead of messing around `report.longrepr` internals and since we don't have a `report` instance at the moment of executing pytest_runtest_call() anyway (it used to be created within a more late pytest_runtest_makereport() hook), use a higher-level item.add_report_section() method to attach log output to a report. However, there is a drawback that now reports show sections named like 'Captured stdlog ...' ('std' is hardcoded). This is an issue of the pytest itself addressed in pytest-dev/pytest#1052. That PR also contains a discussion on deprecating Item.add_report_section(), however the same approach is still used by 'pytest.capture', so it should be fine to use it here as well. This change also removes the use of the deprecated '__multicall__', so that fixes eisensheng#3.
Take advantage of `@pytest.mark.hookwrapper` facility and use more idiomatic pytest_runtest_call(item) hook for performing capturing (in fact, the same is used by the core 'pytest.capture' module). Instead of messing around `report.longrepr` internals and since we don't have a `report` instance at the moment of executing pytest_runtest_call() anyway (it used to be created within pytest_runtest_makereport() hook), use a higher-level item.add_report_section() method to attach log output to a report. However, there is a drawback that now reports show sections named like 'Captured stdlog ...' ('std' is hardcoded). Nevertheless this is likely to be an issue of the pytest itself. It is addressed in pytest-dev/pytest#1052, and that PR also contains a discussion on deprecating Item.add_report_section(). However, the same approach is still used by 'pytest.capture', so it should be fine to use it here as well. This change also removes the use of the deprecated '__multicall__', so that fixes eisensheng#3.
When using pytest-catchlog with pytest from their git repo and
-rw
(show warnings), I get:The text was updated successfully, but these errors were encountered: