test: Convert test_apt_conf_v1.py from unittest to pytest#6522
Closed
GautamThorani wants to merge 1 commit into
Closed
test: Convert test_apt_conf_v1.py from unittest to pytest#6522GautamThorani wants to merge 1 commit into
GautamThorani wants to merge 1 commit into
Conversation
- Remove unittest.TestCase inheritance - Use pytest fixtures (tmpdir) instead of setUp/tearDown - Convert self.assert* methods to bare assert statements - Follow cloud-init pytest guidelines - No functional changes, only test framework migration
Collaborator
|
@GautamThorani thank you so much for presenting this PR and improving cloud-init. Unfortunately I think this is a duplicate of #6520 which seems to have arrived just before your PR. This effort is challenging to deal with in parallel without occasional duplication as multiple devs are touching this space at the same time :/. |
Collaborator
|
Additional note: an additional boon to avoid duplication in testing in #6250 is the use of pytest fixtures too. |
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.
Refactored tests/unittests/config/test_apt_conf_v1.py to use pytest instead of unittest.TestCase as part of the pytest migration effort.
Related: #6427