Skip to content

Commit 88464be

Browse files
authored
Merge pull request #9780 from pfmoore/test_fixes
Fix some tests that are checking logs incorrectly
2 parents 44f0791 + 55d2d0d commit 88464be

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/unit/test_resolution_legacy_resolver.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ def test_sort_best_candidate__has_non_yanked(self, caplog, monkeypatch):
201201
"""
202202
Test unyanked candidate preferred over yanked.
203203
"""
204+
# Ignore spurious DEBUG level messages
205+
# TODO: Probably better to work out why they are occurring, but IMO the
206+
# tests are at fault here for being to dependent on exact output.
207+
caplog.set_level(logging.WARNING)
204208
candidates = [
205209
make_mock_candidate('1.0'),
206210
make_mock_candidate('2.0', yanked_reason='bad metadata #2'),
@@ -217,6 +221,10 @@ def test_sort_best_candidate__all_yanked(self, caplog, monkeypatch):
217221
"""
218222
Test all candidates yanked.
219223
"""
224+
# Ignore spurious DEBUG level messages
225+
# TODO: Probably better to work out why they are occurring, but IMO the
226+
# tests are at fault here for being to dependent on exact output.
227+
caplog.set_level(logging.WARNING)
220228
candidates = [
221229
make_mock_candidate('1.0', yanked_reason='bad metadata #1'),
222230
# Put the best candidate in the middle, to test sorting.
@@ -253,6 +261,10 @@ def test_sort_best_candidate__yanked_reason(
253261
"""
254262
Test the log message with various reason strings.
255263
"""
264+
# Ignore spurious DEBUG level messages
265+
# TODO: Probably better to work out why they are occurring, but IMO the
266+
# tests are at fault here for being to dependent on exact output.
267+
caplog.set_level(logging.WARNING)
256268
candidates = [
257269
make_mock_candidate('1.0', yanked_reason=yanked_reason),
258270
]

0 commit comments

Comments
 (0)