-
Notifications
You must be signed in to change notification settings - Fork 35
Convert test_loaders_pydantic.py to pytest format #446
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
Convert test_loaders_pydantic.py to pytest format #446
Conversation
vladistan
commented
Aug 2, 2025
- Extract loader_test helper function from base class
- Convert 4 test methods to standalone functions
- Test both YAML and JSON loaders with different models
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #446 +/- ##
=======================================
Coverage 77.38% 77.38%
=======================================
Files 52 52
Lines 4479 4479
Branches 979 979
=======================================
Hits 3466 3466
Misses 785 785
Partials 228 228 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use pytest.mark.parametrize
instead of the individual test functions
4150589
to
87c9f70
Compare
87c9f70
to
c1c94ae
Compare
bb35ddc
to
96d34dc
Compare
weird... works on my machine :-( |
e96c670
to
4089c9f
Compare
The issue here is that there is a test somewhere that's creating the files that these tests are using for comparison (the files already exist if you've run the tests locally, which is why it's so hard to debug locally). Files need to be added to the repo for these comparisons to execute correctly. The potentially bigger problem is that some directories are being git-ignored and this problem may affect numerous files in the repo. |
929b645
to
af32ced
Compare
af32ced
to
2ae80c2
Compare
- Extract loader_test helper function from base class - Convert 4 test methods to standalone functions - Test both YAML and JSON loaders with different models
219b8d6
to
c694b9c
Compare
Ahh ... thanks for digging it up. So looks like we are indeed reading other tests outputs, I don't think it's a right thing to do. I copied those outputs into the input directory they are rather short. I think original test was working because it was importing things from other test files which is also not right thing to do. I am going to clean it up and get ready for merging. |
c694b9c
to
f2ddd0e
Compare
Explicitly add input files for test cases do not read test inputs from output directory
f2ddd0e
to
883e590
Compare
Ok now all tests are passing |
@@ -0,0 +1,20 @@ | |||
id: S001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is identical to the other file -- I would just have a single file, book_series_lotr.yaml
.
@@ -0,0 +1,41 @@ | |||
persons: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like this is also identical to the yaml version -- just add one, no need for duplicates.