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:
parent
1b2ae22e7b
commit
a89ede7da3
1 changed files with 5 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue