Skip to content

chore(tests): updated helpers for cleaner test files#43

Merged
petruki merged 1 commit intomasterfrom
staging
Mar 29, 2026
Merged

chore(tests): updated helpers for cleaner test files#43
petruki merged 1 commit intomasterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented Mar 29, 2026

This pull request refactors the test suite to centralize and standardize test helpers, resulting in cleaner and more maintainable test files. The main change is the introduction of a new tests/helpers.py module containing common test setup functions. All test files are updated to use these helpers, reducing code duplication and improving consistency. Additionally, usage of ContextOptions is now preferred for context configuration, making test setups more explicit and flexible.

Key changes include:

Test helper centralization and import updates:

  • Added a new tests/helpers.py module with reusable helper functions for setting up test contexts, mocking auth and API responses, and configuring snapshots. Test files now import these helpers instead of defining their own.
  • Removed duplicate helper functions from individual test files, replacing them with imports from tests/helpers.py for consistency and maintainability. [1] [2] [3] [4]

Test setup improvements:

  • Updated all test files to use the new given_context helper, passing options=ContextOptions(...) where appropriate. This makes context configuration more explicit and supports advanced options for snapshot location, environment, and other settings. [1] [2] [3] [4] [5] [6] [7] [8] Ffefaa67L10R12, [9] [10] [11] [12] [13] [14] [15] [16]

Dependency update:

  • Updated the pytest-cov development dependency version from 7.0.0 to 7.1.0 in Pipfile.

These changes improve code reuse, test clarity, and maintainability across the test suite.

@petruki petruki self-assigned this Mar 29, 2026
@petruki petruki added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file labels Mar 29, 2026
@sonarqubecloud
Copy link
Copy Markdown

@petruki petruki merged commit becf4f0 into master Mar 29, 2026
15 checks passed
@petruki petruki deleted the staging branch March 29, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant