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

False positive no-member after assert isinstance #4693

Open
fluffy-critter opened this issue Jul 8, 2021 · 1 comment
Open

False positive no-member after assert isinstance #4693

fluffy-critter opened this issue Jul 8, 2021 · 1 comment
Labels
Control flow Requires control flow understanding False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@fluffy-critter
Copy link

fluffy-critter commented Jul 8, 2021

Steps to reproduce

In https://github.com/PlaidWeb/Authl/blob/dc53e065e7cfe5e21bcfb169aea4588293531da8/tests/handlers/test_fediverse.py#L89:

    result = handler.check_callback(result.url, parse_args(result.url), {})
    assert isinstance(result, disposition.Verified)
    assert result.identity == 'https://mastodon.example/@moo'
    assert result.redir == 'qwerpoiu'
    assert result.profile == { 
        'name': 'moo friend',
        'bio': 'a cow',
        'avatar': 'https://placekitten.com/1280/1024',
        'homepage': 'https://moo.example',
        'pronouns': 'moo/moo'
    }

Current behavior

tests/handlers/test_fediverse.py:93:11: E1101: Instance of 'Error' has no 'profile' member (no-member)

Expected behavior

In this particular test, result can never be disposition.Error and there's even a previous assertion to ensure that it's disposition.Verified which does have the 'profile' member. I assume that there's some erroneous caching of result's type from another test.

pylint --version output

Result of pylint --version output:

pylint 3.0.0-a4
astroid 2.6.2
Python 3.8.6 (default, Jan  6 2021, 12:14:27) 
[Clang 12.0.0 (clang-1200.0.32.28)]
@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code Control flow Requires control flow understanding labels Jul 8, 2021
@jolaf
Copy link

jolaf commented Jul 21, 2021

I've encountered this error too – twice already.

@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jul 2, 2022
@jacobtylerwalls jacobtylerwalls changed the title False positive no-member False positive no-member after assert isinstance Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Control flow Requires control flow understanding False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

No branches or pull requests

3 participants