1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

tests: Check only the last output lines

This commit is contained in:
Pradyun Gedam 2020-07-27 19:22:15 +05:30
parent 1b2ae22e7b
commit a89ede7da3
No known key found for this signature in database
GPG key ID: FF99710C4332258E

View file

@ -3,9 +3,11 @@ from tests.lib import create_test_package_with_setup
def matches_expected_lines(string, expected_lines):
# Ignore empty lines
output_lines = set(filter(None, string.splitlines()))
# Match regardless of order
return set(output_lines) == set(expected_lines)
output_lines = list(filter(None, string.splitlines()))
# We'll match the last n lines, given n lines to match.
last_few_output_lines = output_lines[-len(expected_lines):]
# And order does not matter
return set(last_few_output_lines) == set(expected_lines)
def test_basic_check_clean(script):