pytest: doc: pytest_ignore_collect: wrong signature

It says to provide a string, but (at least in some place) is a py.path.local.

Ref: https://github.com/pytest-dev/pytest/blob/e3e57a755b03f8cd9219c4db490c180fa0543785/src/_pytest/hookspec.py#L191

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (20 by maintainers)

Commits related to this issue

Most upvoted comments

This leads me to believe that the same hook would sometimes be called with str objects, and others with py.path.local. Isn’t that the case?

I haven’t checked the details, just reported it - otherwise it would have been a PR already… 😉 Sorry for not being clear, but that was what I’ve implied with “at least in some place”.

OK, took the time to review this. In the case of pytest_ignore_collect, every call that I can see in pytest passes a py.local.path instance. So for pytest_ignore_collect, it is clear we should only update the docstring, as every call is getting a py.local.path.

Checked pytest_collect_directory, pytest_collect_file, and pytest_pycollect_makemodule: same thing, we always pass a py.local.path instance.

So in the end, sorry about the confusion, I misunderstood the issue.

@DamianSkrzypczak: in summary, we just need to update the docstring of those hooks to state that they receive py.local.path objects, and not str objects as stated in the docs.

@DamianSkrzypczak Yes, go ahead… 😃