Merge pull request #9780 from pfmoore/test_fixes

Fix some tests that are checking logs incorrectly
This commit is contained in:
Paul Moore 2021-04-07 14:52:25 +01:00 committed by GitHub
commit 88464bec96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -201,6 +201,10 @@ class TestYankedWarning:
"""
Test unyanked candidate preferred over yanked.
"""
# Ignore spurious DEBUG level messages
# TODO: Probably better to work out why they are occurring, but IMO the
# tests are at fault here for being to dependent on exact output.
caplog.set_level(logging.WARNING)
candidates = [
make_mock_candidate('1.0'),
make_mock_candidate('2.0', yanked_reason='bad metadata #2'),
@ -217,6 +221,10 @@ class TestYankedWarning:
"""
Test all candidates yanked.
"""
# Ignore spurious DEBUG level messages
# TODO: Probably better to work out why they are occurring, but IMO the
# tests are at fault here for being to dependent on exact output.
caplog.set_level(logging.WARNING)
candidates = [
make_mock_candidate('1.0', yanked_reason='bad metadata #1'),
# Put the best candidate in the middle, to test sorting.
@ -253,6 +261,10 @@ class TestYankedWarning:
"""
Test the log message with various reason strings.
"""
# Ignore spurious DEBUG level messages
# TODO: Probably better to work out why they are occurring, but IMO the
# tests are at fault here for being to dependent on exact output.
caplog.set_level(logging.WARNING)
candidates = [
make_mock_candidate('1.0', yanked_reason=yanked_reason),
]