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

Handle gin.bind_parameter in tests #395

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Handle gin.bind_parameter in tests #395

merged 1 commit into from
Dec 5, 2024

Conversation

mtrofin
Copy link
Collaborator

@mtrofin mtrofin commented Dec 5, 2024

If a test needs to gin.bind_parameter it should also clear that, or make the binding within a gin.config_scope, otherwise the bindings may leak to other tests if all the tests are run by e.g. pytest.

This patch uses both approaches: for tests that set up bindings in setUp we clear in tearDown, else we use the scoped approach.

Issue #394

If a test needs to `gin.bind_parameter` it should also clear that, or
make the binding within a `gin.config_scope`, otherwise the bindings may
leak to other tests if all the tests are run by e.g. pytest.

This patch uses both approaches: for tests that set up bindings in `setUp`
we clear in `tearDown`, else we use the scoped approach.

Issue google#394
@mtrofin
Copy link
Collaborator Author

mtrofin commented Dec 5, 2024

Note: tested by re-running PR #393 with the explicit gin.clear_config() removed.

Copy link
Collaborator

@tvmarino tvmarino left a comment

Choose a reason for hiding this comment

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

LGTM

@mtrofin mtrofin merged commit 14edc8a into google:main Dec 5, 2024
15 checks passed
@mtrofin mtrofin deleted the gin branch December 5, 2024 01:10
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.

2 participants