【发布时间】:2021-07-13 12:45:43
【问题描述】:
test_pytest.py 位于测试目录中,它包含用于测试机器学习工作流程的自动化代码(以下方法)。
def test_workflow(caplog,test_name,test_params,test_step):,
def test_upload_and_import_data(input_params, output_params,):,
def test_feature_eng(input_params, output_params):,
def test_auto_training(input_params, output_params, problem_type):,
def test_get_prediction(input_params, output_params):
def test_retraining(response):
def delete_ai_service():
QA_test 目录位于 test_data->tests 中。 它包含 json 文件,为不同数据集的上述方法提供输入和预期输出。 例如,
{
"Car_prices dataset" : [
{
"dataImport": {
"input": {
"test_filename": "carprices.csv",
"file_location": "AWS"
},
"expectedOutput": {
"result" : "success"
}
}
},
{
"featureEngineering": {
"input": {
"column": "MSRP",
"waitTime": 60,
"problemType" : "auto"
},
"expectedOutput": {
"result" : "Completed"
}
}
},
'
'
'
]
}
这是现有的 tox 文件。
[tox]
envlist = py38
[testenv]
deps =
pytest
pytest-html
pytest-sugar
pytest-logger
allure-pytest
pytest-xdist
pytest_steps
datetime
oauth2client
gspread
aiclub
commands =
pytest -s -v -k _workflow --html=test_report.html --alluredir=allure-results/ -n auto --dist=loadfile
allure serve allure-results
目前,当我在终端中键入 tox 时,它会运行整个测试套件,运行所有数据集的所有工作流。 如何仅针对 QA_test 目录中的测试用例(json 文件)运行测试工作流程?
【问题讨论】: