strawberry
strawberry copied to clipboard
fix: ignored test changed, annotation magic string removed
Description
Before that fix tests runs with ignored pytest status. I fixed that small bug, also i changed magic strings in StrawberryAnnotation constructor, because its able to input object | str, so i think object is better.
Types of Changes
- [ ] Core
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement/optimization
- [ ] Documentation
Issues Fixed or Closed by This PR
No issues
Checklist
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [ ] I have added tests to cover my changes.
- [x] I have tested the changes and verified that they work and don't break anything (as well as I can manage).
Summary by Sourcery
Fix the forward reference resolution tests to use the actual class object for StrawberryAnnotation instead of strings, preventing them from being ignored by pytest
Bug Fixes:
- Ensure forward reference tests run correctly by correcting StrawberryAnnotation instantiation
Tests:
- Use class objects rather than magic strings in test_forward_references to resolve annotations
Reviewer's Guide
Updated forward reference tests to pass actual class objects to StrawberryAnnotation and adjusted namespace setup, resolving pytest detection issues and ensuring proper test execution.
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Replaced string-based annotations with direct class references in forward reference tests |
|
tests/types/resolving/test_forward_references.py |
| Adjusted namespace assembly placement for local/global resolution |
|
tests/types/resolving/test_forward_references.py |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
@wimble3 👋 can you show me how the test was previously ignored? 😊
Hello, @patrick91 After your message I checked this again, so... my bad, all works normally Let's agree that it was a magnetic storm?🙄
@wimble3 ahaha no worries!