Skip to content
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

Closed
The-Compiler opened this issue Jul 1, 2015 · 5 comments
Closed

__multicall__ being deprecated in upcoming pytest release #3

The-Compiler opened this issue Jul 1, 2015 · 5 comments

Comments

@The-Compiler
Copy link
Collaborator

When using pytest-catchlog with pytest from their git repo and -rw (show warnings), I get:

.../pytest_catchlog.py:71 'pytest_runtest_makereport' hook uses deprecated __multicall__ argument
@The-Compiler
Copy link
Collaborator Author

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?
@abusalimov Is it okay if I introduce merge conflicts in your PR (sorry!)?

@abusalimov
Copy link
Collaborator

@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.
I arrived to Prague yesterday and now I have better Internet here and a bit more quite time. I'm going to fix remaining tests and force-push #7 this evening so that you could review the corresponding __multicall__ fix.

Is it OK for you?

@The-Compiler
Copy link
Collaborator Author

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!

@eisensheng
Copy link
Owner

I've stripped out any API-breaking changes from the PR recently, but have not pushed yet because of few failing tests.

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 __multicall__ and introduce the API break with a 2.0 version.

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 …)

@abusalimov
Copy link
Collaborator

That doesn't mean that I've thrown all that changes into to a trashcan ♻️
I was going to suggest them in a separate PR, just not to block #7 for too long.

abusalimov added a commit to abusalimov/pytest-catchlog that referenced this issue Oct 1, 2015
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.
abusalimov added a commit to abusalimov/pytest-catchlog that referenced this issue Nov 16, 2015
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants