Skip to content

Commit deed105

Browse files
committed
test: Display difference in mismatched e2e files.
1 parent f21dda0 commit deed105

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: poetry run mypy --show-error-codes openapi_python_client
5252

5353
- name: Run pytest
54-
run: poetry run pytest --cov=openapi_python_client --cov-report=term-missing tests end_to_end_tests
54+
run: poetry run pytest --cov=openapi_python_client --cov-report=term-missing tests end_to_end_tests/test_end_to_end.py
5555

5656
- name: Generate coverage report
5757
shell: bash

end_to_end_tests/test_end_to_end.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ def _compare_directories(
3939
expected_path_mismatches = []
4040
for file_name in mismatches:
4141
mismatch_file_path = test_subject.joinpath(file_name)
42-
expected_content = expected_differences.get(mismatch_file_path)
43-
if expected_content is None:
44-
continue
42+
43+
if mismatch_file_path in expected_differences:
44+
expected_content = expected_differences[mismatch_file_path]
45+
expected_path_mismatches.append(mismatch_file_path)
46+
else:
47+
expected_content = (record / file_name).read_text()
4548

4649
generated_content = (test_subject / file_name).read_text()
4750
assert generated_content == expected_content, f"Unexpected output in {mismatch_file_path}"
48-
expected_path_mismatches.append(mismatch_file_path)
4951

5052
for path_mismatch in expected_path_mismatches:
5153
matched_file_name = path_mismatch.name

0 commit comments

Comments
 (0)