Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix junit writing bug introduced in #16388 #16417

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

mrwright
Copy link
Contributor

@mrwright mrwright commented Nov 6, 2023

#16388 introduced a bug where, with --junit-format=global, the junit file would indicate an error (with no message) even if everything passed. That was because _generate_junit_contents would check if messages_by_file was empty or not to determine if there were failures, but with --junit-format=global we'd pass in a dictionary of the form {None: all_messages}; all_messages would be empty, but the resulting dictionary wouldn't be.

The fix is to pass in an empty dictionary if there are no messages.

I've tested manually with --junit-format=global and --junit-format=per_file in the successful case to make sure the files are written correctly now.

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Diff from mypy_primer, showing the effect of this PR on open source code:

discord.py (https://github.com/Rapptz/discord.py): typechecking got 1.08x faster (172.1s -> 158.9s)
(Performance measurements are based on a single noisy sample)

@msullivan msullivan merged commit 285519c into python:master Nov 7, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants