我想为不同的命令行选项并行运行一个测试模块。可以在pytest中实现吗?因此,例如,如果我有一个名为test_webservice.py的测试模块,并且在运行时说“ url”,则我接受一个命令行参数。我目前使用以下命令运行此命令:
python -m pytest test_webservice.py --url“ https://example.com”
,然后再次输入其他网址:
python -m pytest test_webservice.py --url“ https://example2.com”
现在,我要同时为两个URL运行test_webservice.py。测试用例保持不变,唯一的变化是URL。有没有办法使用pytest做到这一点?