Beispiel #1
0
def my_set_class():
    #只会在某个类里面去执行一次
    request = Request()
    mysql = MysqlUntil(return_dacit=True)
    yield (request, mysql)

    print('finish my class')
    request.session.close()  # 用完记得关闭session
    mysql.close()  # 关闭数据库 mysql
Beispiel #2
0
 def setUpClass(cls):
     cls.request = Request()  # 实例化对象,建立一个session会话
     cls.mysql = MysqlUntil(return_dacit=True)
Beispiel #3
0
 def setUpClass(cls):
     #cls 代表的是类名  类的本身
     # 每个测试类里面去运行的操作放到类方法里面
     #cls.request 设置一个类变量
     cls.request = Request()  # 实例化对象,建立一个session会话
     cls.mysql = MysqlUntil(return_dacit=True)
Beispiel #4
0
 def setUpClass(cls):
     cls.request = Request()  # 它是一次会话,会把每次请求的cookie保存起来
     cls.mysql = MysqlUntil()
Beispiel #5
0
 def setUpClass(cls):
     cls.request = Request()  # 它是一次会话,会把每次请求的cookie保存起来
     cls.mysql = MysqlUntil(return_dacit=True)
Beispiel #6
0
 def setUpClass(cls):
     cls.request = Request()
     cls.mysql = MysqlUntil(return_dacit=True)