我正在研究一个转译器并想尝试 TDD,但测试似乎没有运行。运行后python test_transpiler.py
,我得到:
15
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
代码是:
import unittest
import transpiler
class TranspilerTDD:
def test_adds_encoding(self):
source = ""
result = transpile(source);
expected = "#coding: utf-8\n"
self.assertEqual(result, expected)
if __name__ == '__main__':
unittest.main()
transpile
函数在哪里transpiler
(我确定它正在工作)。
怎么了?
改变
class TranspilerTDD:
至
class TranspilerTDD(unittest.TestCase):
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句