Skip to content

Commit

Permalink
Fix tests for reverse depency graph
Browse files Browse the repository at this point in the history
pyyaml is now returned as PyYAML.

Signed-off-by: Oz Tiram <[email protected]>
  • Loading branch information
oz123 committed Jan 4, 2024
1 parent c873790 commit abefb15
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,28 @@ def test_pipenv_graph_reverse(pipenv_instance_private_pypi):

for dep_name, dep_constraint in requests_dependency:
pat = fr'{dep_name}==[\d.]+'
dep_match = re.search(pat, output, flags=re.MULTILINE)
dep_match = re.search(pat,
output,
flags=re.MULTILINE | re.IGNORECASE)
assert dep_match is not None, f'{pat} not found in {output}'

# openpyxl should be indented
if dep_name == 'openpyxl':
openpyxl_dep = re.search(r'^openpyxl', output, flags=re.MULTILINE)
openpyxl_dep = re.search(r'^openpyxl',
output,
flags=re.MULTILINE | re.IGNORECASE)
assert openpyxl_dep is None, f'openpyxl should not appear at beginning of lines in {output}'

assert 'openpyxl==2.5.4 [requires: et-xmlfile]' in output
else:
dep_match = re.search(fr'^[ -]*{dep_name}==[\d.]+$', output, flags=re.MULTILINE)
dep_match = re.search(fr'^[ -]*{dep_name}==[\d.]+$',
output,
flags=re.MULTILINE | re.IGNORECASE)
assert dep_match is not None, f'{dep_name} not found at beginning of line in {output}'

dep_requests_match = re.search(fr'└── tablib==0.13.0 \[requires: {dep_constraint}', output, flags=re.MULTILINE)
dep_requests_match = re.search(fr'└── tablib==0.13.0 \[requires: {dep_constraint}',
output,
flags=re.MULTILINE | re.IGNORECASE)
assert dep_requests_match is not None, f'constraint {dep_constraint} not found in {output}'
assert dep_requests_match.start() > dep_match.start()

Expand Down

0 comments on commit abefb15

Please sign in to comment.