Skip to content

Conversation

@AlessandroMiola
Copy link
Contributor

@AlessandroMiola AlessandroMiola commented Jun 24, 2024

Change Summary

Add a tiny case to increase coverage of pydantic\aliases.py to 100%.
Tests for forbidden string indexing of AliasPath argument via the search_dict_for_path utility.

note: I thought that the newly added assertions could fit into the existing test_validation_alias_parse_data, therefore I didn't add a new test function. Happy to change if you think otherwise (or get guidance in any case)!

Related issue number

Contributes to #7656.

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Jun 24, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 24, 2024

CodSpeed Performance Report

Merging #9740 will not alter performance

Comparing AlessandroMiola:aliases-increase-test-cov (c4c6fec) with main (941c021)

Summary

✅ 13 untouched benchmarks

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AlessandroMiola,

Thanks for your contribution here!

Could we extract this logic into a separate test, maybe called test_search_dict_for_path or something similar? I think that'll help to keep things organized.

Awesome work on increasing coverage here!

@pydantic-hooky pydantic-hooky bot added the awaiting author revision awaiting changes from the PR author label Jun 24, 2024
@sydney-runkle
Copy link
Contributor

As a side note, I wonder if we can add a more clear coverage integration to PRs that adds a comment like the codspeed integration to celebrate increases in test coverage + warn against regressions :). I suppose the CI job is fine for now, but if anyone is interested, this could be a cool CI focused task.

@AlessandroMiola
Copy link
Contributor Author

AlessandroMiola commented Jun 24, 2024

As a side note, I wonder if we can add a more clear coverage integration to PRs that adds a comment like the codspeed integration to celebrate increases in test coverage + warn against regressions :). I suppose the CI job is fine for now, but if anyone is interested, this could be a cool CI focused task.

It would be nice, indeed. I'll try to dig into it :)

@sydney-runkle sydney-runkle added relnotes-ignore Omit this PR from the release notes. and removed awaiting author revision awaiting changes from the PR author relnotes-fix Used for bugfixes. labels Jun 24, 2024
@sydney-runkle sydney-runkle enabled auto-merge (squash) June 24, 2024 16:33
@sydney-runkle sydney-runkle merged commit 20b9176 into pydantic:main Jun 24, 2024
@AlessandroMiola AlessandroMiola deleted the aliases-increase-test-cov branch June 24, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotes-ignore Omit this PR from the release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants