0

I have question about Robotframework and Unittest (python): In Robotframework, there is possiblity to change variable in command line, for example: pybot -d Results -v ENVIRONMENT:stage Test01.robot . Do you know any possibility to change it in unittest (python test framework) due command line?

A. Kootstra
  • 6,827
  • 3
  • 20
  • 43
e p
  • 1
  • Pardon my French, but what does this question has to do with RobotFramework - apart from using it as an example of a system that accept variable setting through its CLI arguments? It's a straightforward `unittest` question. – Todor Minakov Jun 23 '18 at 05:28
  • To your question - your unittest module most probably has `if __name__ == "__main__":` section - handle any CLI arguments passed in it, and change the tests' variables. Mind this is highly unorthodox. Here's [a question and answers how, and why not](https://stackoverflow.com/questions/11380413/python-unittest-passing-arguments) – Todor Minakov Jun 23 '18 at 05:33
  • Ok - I am not proffesional in unittest, but I've worked in Robot Framework and I'm interested in approach to CI in unitest: – e p Jun 25 '18 at 12:53
  • Sorry: there is all of my comment: Ok - I am not proffesional in unittest, but I've worked in Robot Framework and I'm interested in approach to CI in unitest: I have my tests in Robot Framework and they are integretad to GitLab and pipeline. .yml contains command: pybot -d Results -v ENVIRONMENT:stage when chcanges are merged into stage env, and `pybot -d Results -v ENVIRONMENT:prod` after deploy to production is buit. So there is my question, maybe I was not clear enough: How You do it in unittest? I have my dictionary with env: `environments = {"Prod": "ccc.com", "stage_1": "https://ff.com" – e p Jun 25 '18 at 12:59

0 Answers0