mbideau / vcardtools

Automatically fix, split, normalize, group and merge/deduplicate vCard and VCF files (even large ones).
GNU General Public License v3.0
46 stars 9 forks source link

Test: Improve robustness by comparing only the last line of error output #18

Open uncaged-coder opened 1 week ago

uncaged-coder commented 1 week ago

Any change in the Python code alters the backtrace, causing the "Empty vCard" test to fail unnecessarily. The failure occurs unless the expected output file (test/cases/Empty vCard/expected/FAILURE) is updated to match the new backtrace, even though the actual issue remains unchanged.

This patch enhances the test by only comparing the last line of the error output: ValueError: Trying to select a name from an empty list of names. This avoids fragile backtrace comparisons and focuses on the relevant error message.