Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @pytest.hookimpl()
- def pytest_addoption(parser):
- """Creates a parser option"""
- # Allows the user to select the test suite they want to run
- parser.addoption("--suite", action="store", default="None"
- , choices=['a', 'b']
- , help="Choose which test suite to run.")
- @pytest.hookimpl()
- def pytest_configure(config):
- print("Determining test directory")
- suite = config.getoption("--suite")
- if suite == "a":
- config.addinivalue_line("testpaths", "tests/a")
- elif suite == "b":
- config.addinivalue_line("testpaths", "tests/b")
Add Comment
Please, Sign In to add comment