【发布时间】:2020-06-29 22:29:12
【问题描述】:
我编写了以下代码来测试我的课程,但出现“在 0.000 中进行 0 次测试”错误:
import unittest
from survey import AnonymousSurvey
class TestAnonymousSurvey(unittest.TestCase):
def test_store_single_response(self):
question="Which language did you first learn to speak?"
my_survey=AnonymousSurvey(question)
my_survey.store_response('English')
self.assertIn('English',my_survey.responses)
if __name__=='__main__':
unittest.main()
【问题讨论】:
-
向我们展示你是如何运行测试的。
-
这能回答你的问题吗? Python unittest - Ran 0 tests in 0.000s
-
@FishingCode 该类确实包含一个以“test”开头的方法名称,所以可能不是这里的原因。
-
@JohnGordon 你到底是什么意思?
-
你必须输入 some 命令,输出“Ran 0 tests in 0.000”...
标签: python