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

cache: NFPlugin: keep known nodeids #6004

Merged
merged 1 commit into from
Oct 22, 2019
Merged

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Oct 19, 2019

Caveat: does not forget about old nodeids

Fixes #5206

Caveat: does not forget about old nodeids

Fixes pytest-dev#5206
@blueyed blueyed added plugin: cache related to the cache builtin plugin type: bug problem that needs to be addressed labels Oct 19, 2019
for item in items:
if item.nodeid not in self.cached_nodeids:
new_items[item.nodeid] = item
self.cached_nodeids.extend(new_items)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With regard to dropping isinstance here: see #3218 (comment)
Should either be kept if we have a test for this (testing/acceptance_test.py worked for me), or have a test to cover it if necessary.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough!

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

for item in items:
if item.nodeid not in self.cached_nodeids:
new_items[item.nodeid] = item
self.cached_nodeids.extend(new_items)
Copy link
Member

Choose a reason for hiding this comment

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

Fair enough!

@blueyed blueyed merged commit 82e9013 into pytest-dev:master Oct 22, 2019
@blueyed blueyed deleted the fix-nf branch October 22, 2019 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: cache related to the cache builtin plugin type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--newest-first forgets about existing nodeids when collection is filtered
2 participants