fix: Convert class-scoped fixtures in built-in integration tests into @classmethods (#3676)#3677
Conversation
… `@classmethod`s (#3676) SSIA, pytest-dev/pytest#14071 ## Summary by Sourcery Update built-in integration tests and related configuration to comply with pytest 9.1 class-scoped fixture requirements. Build: - Bump pytest testing dependency to >=9.1 and remove obsolete filterwarning for deprecated instance-method class-scoped fixtures. Tests: - Convert class-scoped fixtures in target CSV and Parquet integration tests to class methods and add type annotations for better compatibility with newer pytest versions. Signed-off-by: Edgar Ramírez Mondragón <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConverts several class-scoped pytest fixtures in the built-in integration tests and dynamic test factory to classmethods to align with pytest 9.1 behavior, and bumps the pytest dependency accordingly, plus a small type hint / control-flow tweak in a CSV target config fixture. Sequence diagram for class-scoped runner fixture as classmethodsequenceDiagram
participant Pytest
participant TestClass
participant test_runner
Pytest->>TestClass: runner()
TestClass->>test_runner: sync_all()
test_runner-->>TestClass: test_runner
TestClass-->>Pytest: test_runner
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Documentation build overview
10 files changed ·
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Converting the class-scoped fixtures to
@classmethods is likely to break pytest’s fixture binding (pytest expects an instanceselffor class-level method fixtures, notcls), so consider keeping them as regular methods or moving them to module-level fixtures instead. - The new type annotation
target: TargetCSVinconfig_file_pathappears to useTargetCSVwithout a local import, which may cause runtime or type-checking issues unlessTargetCSVis already imported or annotations are postponed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Converting the class-scoped fixtures to `@classmethod`s is likely to break pytest’s fixture binding (pytest expects an instance `self` for class-level method fixtures, not `cls`), so consider keeping them as regular methods or moving them to module-level fixtures instead.
- The new type annotation `target: TargetCSV` in `config_file_path` appears to use `TargetCSV` without a local import, which may cause runtime or type-checking issues unless `TargetCSV` is already imported or annotations are postponed.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v0.54 #3677 +/- ##
==========================================
+ Coverage 92.33% 93.81% +1.47%
==========================================
Files 73 73
Lines 5951 5952 +1
Branches 731 731
==========================================
+ Hits 5495 5584 +89
+ Misses 360 273 -87
+ Partials 96 95 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- **fix: Ensure stream name is include in log message when ACTIVATE_VERSION forces _sdc metadata columns (meltano#3650)** - **chore: Release v0.54.3 (meltano#3651)** - **fix: Emitted `ACTIVATE_VERSION` now honor the stream aliases configured with stream maps (meltano#3654)** - **chore: Release v0.54.4 (meltano#3655)** - **chore: Lock file maintenance** - **fix: Convert class-scoped fixtures in built-in integration tests into `@classmethod`s (meltano#3676) (meltano#3677)** - **chore: Release v0.54.5 (meltano#3678)** ## Summary by Sourcery Release version v0.54.5 and align templates, docs, and tooling with the new version. Bug Fixes: - Document the fix converting class-scoped fixtures in built-in integration tests to use @classmethods in the changelog. Enhancements: - Update cookiecutter tap/target/mapper templates to depend on singer-sdk v0.54.5. Build: - Update project version metadata to 0.54.5 in pyproject and related tooling configuration. Documentation: - Bump documented release version to 0.54.5 in the Sphinx configuration and GitHub bug report template. --------- Signed-off-by: Edgar Ramírez Mondragón <[email protected]> Co-authored-by: MeltyBot <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
SSIA, backport of #3676
Summary by Sourcery
Convert class-scoped pytest fixtures in built-in integration tests to class methods and update pytest version constraint for testing.
Enhancements:
Build:
Tests: