Skip to content

Set optimal fixture scope for resources#46

Open
pawelad wants to merge 1 commit into
mainfrom
fix-resource-fixture-scope-6090339659672356690
Open

Set optimal fixture scope for resources#46
pawelad wants to merge 1 commit into
mainfrom
fix-resource-fixture-scope-6090339659672356690

Conversation

@pawelad

@pawelad pawelad commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Set the optimal fixture scope for AccountsResource and PotsResource to function. This ensures each test starts with a fresh instance, avoiding side effects from internal caching of API responses. Removed the related TODO in test_accounts.py.


PR created automatically by Jules for task 6090339659672356690 started by @pawelad

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

The `AccountsResource` and `PotsResource` fixtures now explicitly use `function` scope to ensure test isolation. This prevents internal state, such as `_cached_accounts` or `_cached_pots`, from leaking between test cases.

- Changed `accounts_resource` fixture scope to `function` in `tests/pymonzo/test_accounts.py` and removed the TODO comment.
- Changed `pots_resource` fixture scope to `function` in `tests/pymonzo/test_pots.py`.

Co-authored-by: pawelad <7062874+pawelad@users.noreply.github.com>
@pawelad pawelad force-pushed the fix-resource-fixture-scope-6090339659672356690 branch from 0bc6635 to 5c5a51f Compare April 29, 2026 23:28
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.

1 participant