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

TestCase attributes trigger N815 #93

Closed
jaap3 opened this issue Jan 28, 2019 · 3 comments
Closed

TestCase attributes trigger N815 #93

jaap3 opened this issue Jan 28, 2019 · 3 comments

Comments

@jaap3
Copy link

jaap3 commented Jan 28, 2019

With the recent release of pep-8-naming I suddenly get N815 warnings for the maxDiff attribute on unittest.TestCases (https://docs.python.org/3/library/unittest.html#unittest.TestCase.maxDiff)

I haven't verified this, but I assume other TestCase attributes will also trigger this (i.e.
failureException (https://docs.python.org/3/library/unittest.html#unittest.TestCase.failureException), longMessage (https://docs.python.org/3/library/unittest.html#unittest.TestCase.longMessage))

@jparise
Copy link
Member

jparise commented Jan 28, 2019

N815 (mixedCased variable names at class scope) and N816 (mixedCased variable names at global scope) are new error codes in the 0.8.0 release. You can disable them to get the previous pep8-naming behavior.

I agree that they're pretty noisy on a code base that uses unittest. I think we should ignore those well-known stdlib symbols by default, perhaps by extending and honoring the ignore-names list when checking for N815/N816. (Currently, ignore-names is only used by N802 errors.)

@5j9, you introduced these new errors. What do you think?

@jparise
Copy link
Member

jparise commented Jan 28, 2019

#43 is somewhat related, too.

@jaap3
Copy link
Author

jaap3 commented Jan 29, 2019

Thanks for the quick fixes 👍

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

No branches or pull requests

2 participants