chore: fix pytest warnings from dataclasses starting with Test#477
Merged
Aaron ("AJ") Steers (aaronsteers) merged 13 commits intomainfrom Apr 15, 2025
Merged
Conversation
…d for classes starting with "Test"
Contributor
Author
|
Original prompt from Aaron: |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Aaron ("AJ") Steers (aaronsteers)
approved these changes
Apr 12, 2025
Contributor
Aaron ("AJ") Steers (aaronsteers)
left a comment
There was a problem hiding this comment.
LGTM, but this is my spinoff. ✅
Would love another pair of eyes.
13 tasks
kwonly args for Test* dataclasses
Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
Co-Authored-By: Aaron <AJ> Steers <aj@airbyte.io>
Aaron ("AJ") Steers (aaronsteers)
approved these changes
Apr 13, 2025
kwonly args for Test* dataclassesTest
Ben Davis (bengineerdavis)
approved these changes
Apr 14, 2025
Ben Davis (bengineerdavis)
left a comment
There was a problem hiding this comment.
These changes make sense to me, and it looks like we only need to customize this behavior for the specific classes concerned, so the default Pytest behavior will still apply everyone else.
LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preface from AJ (Aaron ("AJ") Steers (@aaronsteers))
This is a spinoff of cherry-picked improvements from:
It resolves many of the warnings from pytest (see below) that I ran into when working on that PR. They look like this:
PytestCollectionWarning: cannot collect test class 'TestLimits' because it has a __init__ constructorThis happens because pytest interprets classes that start with the word
Testas a pytest test class. The resolution is to declare__test__ = falsein the class definition, which signals to Pytest that the class is not a test class.Apart from resolving warnings and making more explicit, this is intended to be a no-op.
fix: dataclasses constructor and pytest warnings
Cherry-picked fixes from PR #349 (#349).
This PR contains only the commits marked 'cherry-pick-me' from the original PR, which fix dataclasses constructor issues and pytest warnings.
Pytest warnings being fixed
This PR resolves the following pytest warnings that occur when collecting tests:
The fix sets
__test__ = Falseon dataclasses that start with "Test" but aren't meant to be collected as test classes by pytest. This prevents pytest from attempting to collect these utility classes as test classes, which fails because they have__init__constructors.Link to Devin run: https://app.devin.ai/sessions/6873cfdb3cac4db2826146028138260c
Requested by: Aaron ("AJ") Steers (aj@airbyte.io)