-
Notifications
You must be signed in to change notification settings - Fork 37
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
perf: only clear assertion _extension
when overridden
#172
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,5 +51,6 @@ def test_multiple_snapshot_extensions(snapshot): | |
""" | ||
assert actual_svg == snapshot(extension_class=SVGImageSnapshotExtension) | ||
assert actual_svg == snapshot # uses initial extension class | ||
assert snapshot._extension is not None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is testing internals. Is there a user facing test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no user effect only that slight performance drawback of generating the extension instance on each assertion There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bit concerned about coupling the internal implementation with the test cases, but am okay with this as a temporary measure until we have perf benchmarking |
||
assert actual_png == snapshot(extension_class=PNGImageSnapshotExtension) | ||
assert actual_svg == snapshot(extension_class=SVGImageSnapshotExtension) |
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.
Could use a
deque
but that seems like premature optimisations