方便全局切换地址
@pytest.fixture()
def config():data = {'测试环境': {'A环境': '127.0.0.1','B环境': '127.0.0.2','C环境': '127.0.0.3','D环境': '127.0.0.4'},}return data.get('测试环境', {}).get('A环境')
import pytestdef test_case001(config):url = 'http://'+str(config)+':8080/api/user/login'print('\n', url)if __name__ == '__main__':pytest.main(['s', 'v', 'test_case6.py'])pass