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

Reduce scope of mock patch to prevent crosstalk #14160

Closed
wants to merge 3 commits into from

Conversation

desertaxle
Copy link
Member

@desertaxle desertaxle commented Jun 19, 2024

Closes #13963

Example

Checklist

  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.
  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

@desertaxle desertaxle added the development Tech debt, refactors, CI, tests, and other related work. label Jun 19, 2024
@desertaxle desertaxle requested a review from a team as a code owner June 19, 2024 21:03
@desertaxle desertaxle enabled auto-merge (squash) June 20, 2024 13:55
Comment on lines +541 to +543
with mock.patch(
"prefect.client.base.httpx.AsyncClient.send", autospec=True
) as send:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is materially different? When you patch a class's instance method, you're going to end up doing it for all instances process-wide

@zhen0
Copy link
Member

zhen0 commented Jul 8, 2024

@desertaxle - does this need a re-review or should it be closed?

@desertaxle
Copy link
Member Author

Fixing this test will require a different approach

@desertaxle desertaxle closed this Jul 8, 2024
auto-merge was automatically disabled July 8, 2024 20:42

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Tech debt, refactors, CI, tests, and other related work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test: tests/client/test_base_client.py::TestCsrfSupport::test_refreshes_token_on_csrf_403
3 participants