Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some tests that are checking logs incorrectly #9780

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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