Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture warnings in JSON tests #326

Merged
merged 1 commit into from
Jun 7, 2024
Merged

Conversation

tovrstra
Copy link
Member

@tovrstra tovrstra commented Jun 7, 2024

This is one of a series of PRs to handle warnings properly in all unit tests. Bigger picture in #313.

I'm planning to YOLO-merge this on Thursday, June 13 unless reviewed earlier.

Summary by Sourcery

This pull request enhances the JSON-related unit tests by adding handling for FileFormatWarning to ensure that warnings are properly captured and tested.

  • Tests:
    • Added handling for FileFormatWarning in multiple JSON-related unit tests to ensure warnings are properly captured and tested.

Copy link
Contributor

sourcery-ai bot commented Jun 7, 2024

Reviewer's Guide by Sourcery

This pull request updates the unit tests in the iodata/test/test_json.py file to properly handle warnings using pytest.warns. This ensures that any FileFormatWarning generated during the tests is captured and handled appropriately.

File-Level Changes

Files Changes
iodata/test/test_json.py Added pytest.warns(FileFormatWarning) context manager to multiple test functions to ensure warnings are properly captured and handled.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

deepsource-io bot commented Jun 7, 2024

Here's the code health analysis summary for commits 4437bbf..c7deb0f. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Shell LogoShell✅ SuccessView Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tovrstra - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

iodata/test/test_json.py Show resolved Hide resolved
Copy link
Member

@PaulWAyers PaulWAyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tovrstra
Copy link
Member Author

tovrstra commented Jun 7, 2024

Thanks! merging...

@tovrstra tovrstra merged commit 3361d49 into theochem:main Jun 7, 2024
10 checks passed
@tovrstra tovrstra deleted the warning-json branch June 7, 2024 18:08
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.

2 participants