当前位置:网站首页>3.2 naming rules of test classes

3.2 naming rules of test classes

2022-06-11 22:10:00 redrose2100

3.2.1 Naming rules for test classes

Before that , All test cases are written in the form of test functions , In fact, test functions can also be encapsulated in test classes , For example, all test cases of a module are encapsulated in a test class , So here is how to name the test class , Just name it casually , Of course not , The following is an example to demonstrate and verify the naming rules of the test class

The test class shall be named with Test start , And the test class cannot have __init__ Initialize playback method

Let's take a look at the following test case code (https://gitee.com/redrose2100/pytest-demo/blob/master/ch03/ex_002/test_demo.py)

class TestDemo(object):
    def test_demo(self):
        print("in TestDemo ...")
        assert 1==1

class testDemo(object
原网站

版权声明
本文为[redrose2100]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206112146280095.html