Fix test isolation in Flask app database tests#2971
Merged
adamtheturtle merged 2 commits intomainfrom Feb 21, 2026
Merged
Conversation
Reset TARGET_MANAGER state between tests by cleaning up cloud and VuMark databases in the autouse fixture. This fixes the leaky test issue that required workaround keys ("v1", "v2", "v3" instead of "1", "2", "3") in test_duplicate_vumark_keys.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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.
Summary
Reset TARGET_MANAGER state between tests by cleaning up cloud and VuMark databases in the autouse fixture. This fixes the leaky test issue where the module-level singleton was persisting state across tests, which required workaround keys ("v1", "v2", "v3" instead of "1", "2", "3") in test_duplicate_vumark_keys.
The fix reuses the public API (remove_cloud_database/remove_vumark_database) to clean up after each test, ensuring proper test isolation.
Changes
Note
Low Risk
Test-only changes that improve isolation by cleaning up shared singleton state; low risk aside from potential flakiness if cleanup interacts with concurrent tests.
Overview
Ensures
tests/mock_vws/test_flask_app_usage.pyno longer leaks state between tests by importing the singletonTARGET_MANAGERand clearing all cloud and VuMark databases in the autouse fixture teardown viaremove_cloud_database/remove_vumark_database.Updates the duplicate VuMark key test to use simple key values again ("1"/"2"/"3") now that prior test-created databases are reliably cleaned up.
Written by Cursor Bugbot for commit 3bdd91e. This will update automatically on new commits. Configure here.