pylint-pytest icon indicating copy to clipboard operation
pylint-pytest copied to clipboard

Add support for raiseerrror (inconsistent-return-statements)

Open kasium opened this issue 3 years ago • 0 comments

Feature request type

  • [X] Suppress false positives from existing pylint warnings
  • [ ] Add new pytest-specific warning
  • [ ] Other

Is your feature request related to a problem? Please describe. pylint emits a warning if raiseerrror is used in combination with other returns

Describe the solution you'd like Disable the warning

Describe alternatives you've considered n/a

Sample code to demonstrate the current imperfect behavior

import pytest

FLAG = True

@pytest.fixture
def foo(request) -> str:
    if FLAG:
        return "huray"
    request.raiseerror("error")

kasium avatar Jun 23 '22 08:06 kasium