debpkg include 0/1 as valid options when parsing bool values in deb822#68997
Merged
Conversation
955765c to
d24f899
Compare
Contributor
|
@Sxderp Please rebase |
d24f899 to
f513d55
Compare
38a6427 to
f6d4e15
Compare
Contributor
Author
|
@dwoz I'm actually having a bit of trouble figuring out how to fix my code and I hope I could get some assistance. The issue. In the test file there are three fixtures that create a "repo" file for use:
When I define my test functions I specifically use the new fixture: def test_get_repo_deb822_with_false(
deb822_repo_bool_false_file: pathlib.Path, mock_apt_config
):
...However, when the test is ran the the existing fixture and my new fixture are BOTH invoked (I added some bugging print statements). $ nox -- tests/pytests/unit/modules/test_aptpkg.py::test_get_repo_deb822_with_false
...
tests/pytests/unit/modules/test_aptpkg.py::test_get_repo_deb822_with_false[no]
running from deb822_repo_bool_false_file
running from deb822_repo_file
FAILEDCan you point to what I'm doing wrong? How do I prevent the deb822_repo_file fixture from running? |
361787c to
66860e7
Compare
Contributor
Author
|
I believe I figured out a solution. I'm not sure it's the best, but the tests are now passing (locally). |
Previously the way the test fixures were loading caused the repo file to get overwritten. Fix this by parametizing which sub-fixture is used for the mock_apt_config.
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.
What does this PR do?
What issues does this PR fix or reference?
Fixes #68996
Previous Behavior
Stacktrace occurred when a deb file was parsed when "0" or "1" were used as False / True
New Behavior
Stacktrace no longer occurs
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes/No