可能性の重複:
ValueError: no such test method in <class 'myapp.tests.SessionTestCase'>: runTestPythonの
import unittest
class BzTestSe(unittest.TestCase):
DEFAULTUSERNAME = 'username-a2'
DEFAULTPASSWORD = 'pass'
DEFAULTHOST = 'localhots'
def __init__(self,username=DEFAULTUSERNAME, password=DEFAULTPASSWORD, host=DEFAULTHOST):
super(unittest.TestCase,self).__init__()
self.username=username
self.password=password
self.host=host
class test_se_topwebsite(BztTestSe):
def setUp(self):
print "setup"
def test_test_se_topwebsite(self):
self.fail()
私は別のファイルから上記のクラスを呼び出すと、私は次のエラーを取得します。私が間違っている場所を教えてください。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "testsuite/test_se.py", line 10, in __init__
super(unittest.Testcase,self).__init__()
File "/usr/lib/python2.7/unittest/case.py", line 184, in __init__
(self.__class__, methodName))
ValueError: no such test method in <class 'testsuite.test_se.BztTestSe'>: runTest
「上記のクラスに電話する」?これは何を意味するのでしょうか? –
申し訳ありません、Pythonの初心者です。私は別のファイルからこのクラスを呼び出しましたが、このエラーは – Somu
で、クラスを呼び出すために他のファイルで使用しているコードを正確に示しています。 –