-
Notifications
You must be signed in to change notification settings - Fork 818
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
rfctr: prepare for adding metadata.orig_elements field #2647
Conversation
8aa85b7
to
fafcf46
Compare
@@ -31,6 +31,7 @@ select = [ | |||
] | |||
ignore = [ | |||
"COM812", # -- over aggressively insists on trailing commas where not desireable -- | |||
"PT005", # -- flags mock fixtures with names intentionally matching private method name -- | |||
"PT011", # -- pytest.raises({exc}) too broad, use match param or more specific exception -- |
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.
Does this change need to be replicated in in .pre-commit-config.yaml
and Makefile
? (note at the top)
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.
Hmm, yeah, good call. I've removed those redundant explicit options definitions. Now they should be picked up from the pyproject.toml
so it's the single source of truth on options.
"method_mock", | ||
"property_mock", | ||
) | ||
|
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.
Not that this needs to be changed, but isn't __all__
used to define what's imported when you use * to import, or is there another use?
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.
Yes, it is, but it also indicates what you are intentionally "exporting" and prevents ruff errors related to "xyz is imported but not used". That's why I have it here.
test_unstructured/unit_utils.py
Outdated
# ------------------------------------------------------------------------------------------------ | ||
# MOCKING FIXTURES | ||
# ------------------------------------------------------------------------------------------------ | ||
# These allow full-featured and type-save mocks to be created simply by adding a unit-test |
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.
type-save or type-safe?
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.
Yep, good catch. Fixed.
fafcf46
to
ac3295d
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.
LGTM
Add utility functions that allow robust mocks to be created by adding a simple unit-test fixture.
ac3295d
to
b70647d
Compare
…IO#2647) **Summary** Some typing modernization in `elements.py` which will get changes to add the `orig_elements` metadata field. Also some additions to `unit_util.py` to enable simplified mocking that will be required in the next PR.
…IO#2647) **Summary** Some typing modernization in `elements.py` which will get changes to add the `orig_elements` metadata field. Also some additions to `unit_util.py` to enable simplified mocking that will be required in the next PR.
Summary
Some typing modernization in
elements.py
which will get changes to add theorig_elements
metadata field.Also some additions to
unit_util.py
to enable simplified mocking that will be required in the next PR.