DRY setup of WorkunitStore in Rust tests#11436
Merged
Merged
Conversation
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Eric-Arellano
commented
Jan 9, 2021
| let workunit_store = WorkunitStore::new(false); | ||
| workunit_store.init_thread_state(None); | ||
|
|
||
| WorkunitStore::setup_for_tests(); |
Contributor
Author
There was a problem hiding this comment.
Please feel free to bikeshed this method name, especially if there's something more idiomatic in Rust.
| })) | ||
| } | ||
|
|
||
| pub fn setup_for_tests() -> WorkunitStore { |
Contributor
Author
There was a problem hiding this comment.
Not sure if this needs docstring. I didn't know what to put in it.
Contributor
There was a problem hiding this comment.
I think it need not have one .... iff you annotate this with #[cfg(test)].
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
jsirois
approved these changes
Jan 9, 2021
tdyas
approved these changes
Jan 9, 2021
Contributor
tdyas
left a comment
There was a problem hiding this comment.
lgtm
too bad, the Rust test runner doesn't have the notion of setup functions like other test frameworks. (There are crates that do that but this PR is good as-is.)
[ci skip-build-wheels]
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[ci skip-build-wheels]