0

i am trying to write test for external application

and i want to be able to configure them

is there any tool, that allows run 'PYTEST'?

--my-custom-argument 42 --app-host some_host --etc

and later in test use those custom arguments

or i can use another way to configure such things?

Nathan
  • 3,558
  • 1
  • 18
  • 38
  • Does this answer your question? [How to pass arguments in pytest by command line](https://stackoverflow.com/questions/40880259/how-to-pass-arguments-in-pytest-by-command-line) – pptaszni Jan 22 '20 at 16:05

1 Answers1

0

if you are already using conftest.py you should be able to do something like:

def pytest_addoption(parser):
    parser.addoption(
        "--cmdopt", action="store", default="type1", help="my option: type1 or type2"
    )

this is a good place to get started: pytest documentation

G.Borella
  • 48
  • 6