Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
'的实例;MyTestClass';没有';assertEqual';成员pylint(无成员)VScode 我试图为Python编程设置我的VSCODEL环境(我现在只用它来编写C++代码)。我建立了非常简单的“Hello world”程序,并为其编写了虚拟测试: from problems.hello_world import HelloWorld class SimpleTest(): def setUp(self): self.hello = HelloWorld() def test_dummy(self): self.assertEqual(True,False)_Python_Visual Studio Code_Vscode Settings_Pylint - Fatal编程技术网

'的实例;MyTestClass';没有';assertEqual';成员pylint(无成员)VScode 我试图为Python编程设置我的VSCODEL环境(我现在只用它来编写C++代码)。我建立了非常简单的“Hello world”程序,并为其编写了虚拟测试: from problems.hello_world import HelloWorld class SimpleTest(): def setUp(self): self.hello = HelloWorld() def test_dummy(self): self.assertEqual(True,False)

'的实例;MyTestClass';没有';assertEqual';成员pylint(无成员)VScode 我试图为Python编程设置我的VSCODEL环境(我现在只用它来编写C++代码)。我建立了非常简单的“Hello world”程序,并为其编写了虚拟测试: from problems.hello_world import HelloWorld class SimpleTest(): def setUp(self): self.hello = HelloWorld() def test_dummy(self): self.assertEqual(True,False),python,visual-studio-code,vscode-settings,pylint,Python,Visual Studio Code,Vscode Settings,Pylint,这个测试通过了,这是错误的,它应该失败!但是我的VScode(在我调用assertEqual的最后一行中)抱怨说,的'SimpleTest'实例没有'assertEqual'成员pylint(没有成员) 它还在导入行中抱怨无法导入“问题。hello\u world”pylint(导入错误) 我的python二进制文件和python测试都在同一个名为problems的文件夹中 我正在使用bazel构建和python 3.7版本。我不知道我的VScode python设置有什么问题,或者什么问题。在

这个测试通过了,这是错误的,它应该失败!但是我的VScode(在我调用assertEqual的最后一行中)抱怨说,
的'SimpleTest'实例没有'assertEqual'成员pylint(没有成员)

它还在导入行中抱怨
无法导入“问题。hello\u world”pylint(导入错误)

我的python二进制文件和python测试都在同一个名为problems的文件夹中

我正在使用bazel构建和python 3.7版本。我不知道我的VScode python设置有什么问题,或者什么问题。在C++环境下运行良好。 在my workspace settings.json中,我启用了pylint,下面是它的内容:

{
    "python.linting.pylintEnabled": true,
    "python.linting.enabled": true,

}
在my settings.json文件中只有两行。对于我的C++程序,我使用单独的工作区(可能是问题所在)。
谢谢你的帮助

您必须实现一个子类
unittest.TestCase
,如

来自problems.hello\u world导入HelloWorld
从unittest导入TestCase
类SimpleTest(测试用例):
def设置(自):
self.hello=HelloWorld()
def测试假人(自身):
self.assertEqual(真、假)