Print the differences in a formatted way.
(differences)
| 817 | # ----------------------------------------------------------------------------- |
| 818 | |
| 819 | def printDifferences(differences): |
| 820 | '''Print the differences in a formatted way.''' |
| 821 | if not differences: |
| 822 | print("No differences found between specification and data library.") |
| 823 | return |
| 824 | |
| 825 | # Group differences by type |
| 826 | byType = {} |
| 827 | for diff in differences: |
| 828 | byType.setdefault(diff.diffType, []).append(diff) |
| 829 | |
| 830 | print(f"\n{'=' * 70}") |
| 831 | print(f"COMPARISON RESULTS: {len(differences)} difference(s) found") |
| 832 | print(f"{'=' * 70}") |
| 833 | |
| 834 | for diffType in DiffType: |
| 835 | if diffType not in byType: |
| 836 | continue |
| 837 | |
| 838 | diffs = byType[diffType] |
| 839 | print(f"\n{diffType.value} ({len(diffs)}):") |
| 840 | print("-" * 50) |
| 841 | |
| 842 | for diff in diffs: |
| 843 | for line in formatDifference(diff): |
| 844 | print(line) |
| 845 | |
| 846 | |
| 847 | # ----------------------------------------------------------------------------- |
no test coverage detected