摘要:
如果fixture中需要入参时,不是直接返回数据,而是返回生成数据的函数。然后可以在测试用例中调用此函数。 @pytest.fixture def make_customer_record(): def _make_customer_record(name): return {"name": nam 阅读全文
摘要:
获取当前的python块名称(即.py文件名) import os module_name = str(os.path.basename(__file__)).split('.')[0] print(module_name) 阅读全文