如何使用docstring作为Python unittest描述?

时间:2015-12-29 02:45:41

标签: python python-unittest

我正在使用Python 3.4.3。 <_p>中将忽略test _ ***方法中的所有docstring

class MovieQueriesTest(ApiBaseTest):
    """Tests for query operations against movies endpoint"""

    def test_query_empty_result(self):
        """
        Query which yields empty results must be well-formed
        """
        response = self.client.get('/api/movies')
        self.assert200(response, 'Empty movie response should have status 200')

未收集文档字符串Tests for query operations against movies endpoint,但测试方法名称为test_query_empty_result

enter image description here

1 个答案:

答案 0 :(得分:0)

这就是Pycharm Monitoring and Managing Tests功能的实现方式。我担心您无法将其配置为显示文档字符串而不是测试名称。