pytest 测试类Class的运用

编写pytest测试用例有一条规则:
测试类要以Class开头,首字母大写
一直没明白测试类用来干嘛的
后来看到一篇文章才明白可以把一些要一起执行的用例放在一个测试类里面
应该是方便后面的时候归类已经只执行此测试类的测试用例吧

import pytest


class Testone():
    a=1
    def test_one(self):
        assert 2 == 2

    def test_two(self):
        b=Testone()
        print(b)
        pass

if __name__=="__main__":
    pytest.main(['-v','test_one.py::Testone','--html=./class.html'])