python:S1144 False positive for autoused private fixtures

Use code below

class Foo:
    @pytest.fixture(autouse=True)
    def __setup(self):
        self._foo = 'foo'

Expected:
No warning

Actual:

Use case:
Base class with mangled name of setup to avoid accidental overwriting.


Even if someone writes __setup method in child class, the setup of parent class will be untouched.

Hi,

Can you provide your SonarLint flavor and version? And are you using it in connected mode with SonarCloud or SonarQube (which version)?

 
Ann

I am using SonarLint as a local PyCharm extension in version 7.3.0.59206

Hi,

Thanks for the details. What’s your SonarLint version?

 
Ann

How could I check this? In a plugin description I have got only this:

1 Like

Hi,

Thanks for the screenshot. It confirms that your SonarLint version is the latest. Sorry, but I thought earlier that you were giving your PyCharm version.

I’ve flagged this for the language experts.

 
Ann

Hello @Grzegorz_Ryznar,

Thank your for reporting this false positive: I created a ticket SONARPY-1257 to track it.

Best regards,
Rudy Regazzoni