为什么PyCharm生成下面的代码模板,当点击“创建新的测试..:”即使我有pytest
作为我的默认测试运行?
如果我的功能是create_training_data
,然后PyCharm将生成此下面的代码:
from unittest import TestCase
class TestCreate_training_data(TestCase):
def test_create_training_data(self):
self.fail()
然而pytest
既不需要进口,也不是子类,有
class TestCreate_training_data(object):
def test_create_training_data(self):
self.fail()
作为已经在入门页面显示就足够了:https://docs.pytest.org/en/latest/getting-started.html
PyCharm只知道此刻创建unittest
测试。请投票选出相应的功能要求:PY-15021。