update run

This commit is contained in:
tlh717 2023-03-16 11:16:57 +08:00
parent 25d36d9fa8
commit a26768f5f4
1 changed files with 2 additions and 4 deletions

6
run.py
View File

@ -8,10 +8,8 @@ import click
@click.command()
@click.option('--mark', '-m', default='', help='传入被标记的case套件, 例: -m login')
def run(mark):
result_path = f'test_cases/{mark}/allure-results' if mark else 'results'
report_path = f'test_cases/{mark}/allure-report' if mark else 'report'
pytest.main(['test_cases', f'-m={mark}', '--clean-alluredir', f'--alluredir={result_path}'])
os.system(f"allure generate -c -o {report_path}")
pytest.main(['test_cases', f'-m={mark}', '--clean-alluredir', '--alluredir=allure-results'])
os.system("allure generate -c -o allure-report")
if __name__ == '__main__':