I'm trying to setup my VScode environment for python programing (I was using it till now only to write c++ code). I set up very simple "Hello world" program and wrote dummy test for it:
from problems.hello_world import HelloWorld
class SimpleTest():
def setUp(self):
self.hello = HelloWorld()
def test_dummy(self):
self.assertEqual(True,False)
This test is passing, which is wrong, it should fail! But my VScode complains (in the last line where I call assertEqual) that Instance of 'SimpleTest' has no 'assertEqual' member pylint (no-member).
It also complains in import line that Unable to import 'problems.hello_world'pylint(import-error) .
My python binary and python test are both in the same folder named problems.
I'm using bazel build and python 3.7 version. I can't figure it out what is wrong with my VScode python setup, or whatever the problem is. With c++ environment it works perfectly. In my workspace settings.json I have pylint enabled, here is the content of it:
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
}
That are only two lines in my settings.json file. For my c++ programs I use separate workspace (might that be the problem?). Thanks for help!