Conversation
|
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.



This pull request introduces a new "test mode" to the
Clientclass, designed to prevent subprocesses like the snapshot watcher from running during tests. This makes it easier to avoid file locking issues in test environments. The implementation adds a new error type, updates documentation, and includes a test to verify the new behavior.Key changes:
Test Mode Feature Implementation
_test_modeflag to theClientclass, initialized withDEFAULT_TEST_MODE, and a statictest_mode()method to enable test mode and prevent subprocesses during tests (switcher_client/client.py). [1] [2] [3]watch_snapshotmethod to reject snapshot watching in test mode, raising a newTestModeError(switcher_client/client.py).Error Handling
TestModeErrorexception to signal operations that are not allowed in test mode, and exported it in the module's__all__list (switcher_client/errors/__init__.py).TestModeErrorwhere needed (switcher_client/client.py).Documentation
README.md).Testing
tests/test_client_watch_snapshot.py).