test: refactor some for loop tests into pytest parametrize #1192
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.
This PR tries to refactor (some) test cases with "for" loop or
subTest
into pytest'sparametrize
fixture functions.Only relatively simple changes are made (more on this in section 3).
1 TestFiles Changed
test/test_jujuversion.py
test/test_log.py
test/test_pebble.py
test/test_private.py
2 Before/After Comparisons
Num of test cases increased because of parametrize, coverage unchanged.
2.1
test_jujuversion.py
Before
After
2.2
test_log.py
Before
After
2.3
test_pebble.py
Before
After
2.4
test_private.py
Before:
After:
2.5 Total Comparisons
Before
After
3 TODO
Need more research on other test files (similar to
test_logs.py
but more complicated), will report back later.