-
Notifications
You must be signed in to change notification settings - Fork 4
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
DM-42376: Fix dump_kwargs TypeError. #281
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #281 +/- ##
==========================================
+ Coverage 87.27% 87.41% +0.13%
==========================================
Files 49 49
Lines 4417 4433 +16
Branches 762 764 +2
==========================================
+ Hits 3855 3875 +20
+ Misses 410 406 -4
Partials 152 152 ☔ View full report in Codecov by Sentry. |
28baf22
to
a11c6b3
Compare
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.
Looks great. Thanks for adding a test.
doc/changes/DM-42376.bugfix.rst
Outdated
@@ -0,0 +1 @@ | |||
Fix dump_kwargs TypeError. |
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.
Fix dump_kwargs TypeError. | |
Fix ``dump_kwargs`` `TypeError` caused by migration to Pydantic 2. |
# to calculate time-stamped runs across a second boundary. | ||
args.output_run = qgraph.metadata["output_run"] | ||
|
||
with makeTmpFile(suffix=".json") as tmpname: |
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.
I had not noticed that there was a special temp file context manager written for this test file. Next time I'm looking I need to replace that with something more standard. The content parameter is only used in one place so it doesn't seem like we are gaining much.
tests/test_cmdLineFwk.py
Outdated
self.assertEqual(taskFactory.countExec, self.nQuanta) | ||
self.assertTrue( | ||
os.path.exists(tmpname) and os.path.getsize(tmpname) > 0, "Failed to create summary file" | ||
) |
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.
I think I'd like the two lines added to read the file back in
with open(tmpname) as fh:
Report.model_validate_json(fh.read())
I think that would mean we wouldn't need the above assertTrue
because it would only work if the file existed and had something in it.
a11c6b3
to
cfd6fbd
Compare
Checklist
doc/changes