Guest User

Untitled

a guest
Jan 12th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. @pytest.hookimpl()
  2. def pytest_addoption(parser):
  3. """Creates a parser option"""
  4.  
  5. # Allows the user to select the test suite they want to run
  6. parser.addoption("--suite", action="store", default="None"
  7. , choices=['a', 'b']
  8. , help="Choose which test suite to run.")
  9.  
  10. @pytest.hookimpl()
  11. def pytest_configure(config):
  12. print("Determining test directory")
  13. suite = config.getoption("--suite")
  14.  
  15. if suite == "a":
  16. config.addinivalue_line("testpaths", "tests/a")
  17.  
  18. elif suite == "b":
  19. config.addinivalue_line("testpaths", "tests/b")
Add Comment
Please, Sign In to add comment