Как передать строку в качестве входных данных во время выполнения сценария Pytest - PullRequest
0 голосов
/ 05 января 2020
# test1.py

class SignUp_Flow:
    ap = argparse.ArgumentParser(description='Specifying Browser and URL to run test on')
    url = ap.add_argument('--url', action='store_const', help='url for testing Application', const='uat')
    browser = ap.add_argument('--browser', action='store_const', help='url for testing Application', const='uat')
    args = ap.parse_args()

(venv) D:\git\Demo>pytest test1.py uat chrome
=========================================================================================================================== test session starts ===========================================================================================================================
platform win32 -- Python 3.8.0, pytest-5.3.2, py-1.8.0, pluggy-0.13.1
rootdir: D:\git\Demo>
plugins: allure-pytest-2.8.6
collected 0 items                                                                                                                                                                                                                                                          

========================================================================================================================== no tests ran in 0.06s ==========================================================================================================================
ERROR: file not found: uat

я хочу передать uat как строку в файл для выбора варианта в моем письменном коде

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...