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

Add typecheck tests for dataclass attributes #4870

Merged

Conversation

david-yz-liu
Copy link
Contributor

@david-yz-liu david-yz-liu commented Aug 19, 2021

Type of Changes

Type
βœ“ πŸ“ Test update (I made up a new type, I didn't know where this fit)

Description

Added additional tests for some basic type-checking of attributes from dataclasses, motivated by the changes in pylint-dev/astroid#1126.

Comments

I didn't add an entry to the Changelog, but I can if you want.

I identified a few false negatives as well in some of the typecheck checks, but I didn't submit any code changes here.

Also, wow the invalid-metaclass error output is... not great?

@david-yz-liu david-yz-liu force-pushed the dataclass-typecheck-tests branch from 26f4d2d to 97e467d Compare August 19, 2021 02:05
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.10.0 milestone Aug 19, 2021
@david-yz-liu
Copy link
Contributor Author

Update: I had to update the test astroid version to 2.7.1 (to include the patch in pylint-dev/astroid#1130). Is this okay? Should I have updated setup.cfg as well?

@Pierre-Sassoulas
Copy link
Member

It's okay to increase the astroid version, actually I forgot to do it after releasing 2.7.1 so thank you. But yes both versions should be in sync, or the test can run properly but the installation fail if the wrong version of astroid is used.

@david-yz-liu david-yz-liu force-pushed the dataclass-typecheck-tests branch from 57f64ab to f1cba50 Compare August 19, 2021 22:15
@david-yz-liu david-yz-liu marked this pull request as ready for review August 19, 2021 22:27
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1148685588

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 92.775%

Totals Coverage Status
Change from base Build 1148622932: 0.01%
Covered Lines: 13445
Relevant Lines: 14492

πŸ’› - Coveralls

@Pierre-Sassoulas Pierre-Sassoulas merged commit 2d05a4e into pylint-dev:main Aug 20, 2021
@Pierre-Sassoulas
Copy link
Member

Thank you for that and the prior refactor !

@Pierre-Sassoulas Pierre-Sassoulas added Maintenance Discussion or action around maintaining pylint or the dev workflow and removed task labels Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants