摘要: 如果fixture中需要入参时,不是直接返回数据,而是返回生成数据的函数。然后可以在测试用例中调用此函数。 @pytest.fixture def make_customer_record(): def _make_customer_record(name): return {"name": nam 阅读全文
posted @ 2020-04-21 14:23 秋寻草 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 获取当前的python块名称(即.py文件名) import os module_name = str(os.path.basename(__file__)).split('.')[0] print(module_name) 阅读全文
posted @ 2020-04-21 13:28 秋寻草 阅读(2872) 评论(0) 推荐(0) 编辑