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

Meaningless error S113 #45

Open
JCHacking opened this issue Sep 25, 2023 · 0 comments
Open

Meaningless error S113 #45

JCHacking opened this issue Sep 25, 2023 · 0 comments

Comments

@JCHacking
Copy link

JCHacking commented Sep 25, 2023

If I have a class with a get method like this, for example:

class Example:
    def get() -> str:
        return "TEST"

And then a test like the following:

import unittest
from unittest import mock

class TestGet(unittest.IsolatedAsyncioTestCase):
    async def test_get(self) -> None:
        with mock.patch("method", return_value=Example.get()):
            self.assertEqual(True, True)

I get error S113 marking the following line with mock.patch("method", return_value=Example.get()):

I understand that this is a meaningless error, so that validation should be improved so that it does not mark things that are not...

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

1 participant