-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathconftest.py
More file actions
41 lines (30 loc) · 854 Bytes
/
conftest.py
File metadata and controls
41 lines (30 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# -*- coding: utf-8 -*-
# @Time : 2018/11/9 15:06
# @Author : litao
# @Project : project
# @FileName: GetRelevance.py
# @Software: PyCharm
import random
import pytest
import allure
import requests
from config.configHost import ConfHost
@pytest.fixture(scope="session", autouse=True)
def env(request):
"""
Parse env config info
"""
host_config = ConfHost()
host = host_config.get_host_conf()
allure.environment(test_platform=host["test_platform"])
allure.environment(mock=host["mock"])
@pytest.fixture(scope="session", autouse=True)
def login(request):
# setup
url = "http://120.79.232.23/api/user/login"
parameter = {"username": "litao", "password": "lt19910301"}
response = requests.post(url=url, data=parameter)
yield
# teardown
print("测试完成")
print(response.json())