Skip to content

Commit

Permalink
Merge pull request #9780 from pfmoore/test_fixes
Browse files Browse the repository at this point in the history
Fix some tests that are checking logs incorrectly
  • Loading branch information
pfmoore authored Apr 7, 2021
2 parents 44f0791 + 55d2d0d commit 88464be
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/test_resolution_legacy_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ def test_sort_best_candidate__has_non_yanked(self, caplog, monkeypatch):
"""
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'),
Expand All @@ -217,6 +221,10 @@ def test_sort_best_candidate__all_yanked(self, caplog, monkeypatch):
"""
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.
Expand Down Expand Up @@ -253,6 +261,10 @@ def test_sort_best_candidate__yanked_reason(
"""
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),
]
Expand Down

0 comments on commit 88464be

Please sign in to comment.