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

[Backport 5.4] Merge pull request #6991 from blueyed/fix-lf-cmdline-args-upstream #7219

Closed
wants to merge 1 commit into from

Conversation

nicoddemus
Copy link
Member

Backport of #6991

But I'm not so sure we should backport this, because it also contains an improvement (albeit small).

@@ -0,0 +1 @@
Collected files are displayed after any reports from hooks, e.g. the status from ``--lf``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should drop this change from the backport? (the changes in src/_pytest/terminal.py)

x
for x in result
if x.nodeid in lastfailed
# Include any passed arguments (not trivial to filter).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one makes sense.

if x.nodeid in lastfailed
# Include any passed arguments (not trivial to filter).
or session.isinitpath(x.fspath)
# Keep all sub-collectors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I don't really understand this one, would you mind explaining what it does?

def pytest_collection_modifyitems(
self, config: Config, items: List[nodes.Item]
) -> Generator[None, None, None]:
yield
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change (and in pytest_collection_modifyitems) needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe this is to ensure the actual code runs as late as possible

in this case this means, its running after most normal hook-wrappers finish (only the last bit of a earlier hook-wrapper could interact with it after that

@nicoddemus
Copy link
Member Author

Closing for now, not sure we will see a 5.4.X before 6.0 anyway.

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

Successfully merging this pull request may close these issues.

None yet

3 participants