fix(spec-specs): tolerate a missing fork cache at json_loader teardown - #3460
Open
mkzung wants to merge 1 commit into
Open
fix(spec-specs): tolerate a missing fork cache at json_loader teardown#3460mkzung wants to merge 1 commit into
mkzung wants to merge 1 commit into
Conversation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
tests/json_loader/conftest.pycloses a fork cache inpytest_sessionfinishthat its ownpytest_sessionstartmay never have created. pytest registers a directory's conftest before session start only when that directory is named on the command line; reached by collection it arrives after, so the start hook here never runs while the finish hook still does.Any run over
tests/that does not nametests/json_loaderhits it. The test passes, the session then dies in teardown, prints no summary and exits 1:Guarding the read matches the
stash.get(key, None)reads inplugins/forks/forks.pyandplugins/consume/simulators/helpers/test_tracker.py. The same command then reports1 passed, 18066 deselectedand exits 0.test_conftest.pycovers both directions: reverting the guard fails the empty-stash test with the sameKeyError, and deleting the teardown body outright fails the other onassert cache.closed.Related Issues or PRs
N/A.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture