title: How to pass an environment variable in command line to pytest to test a function
body: <p>I have a script using os.environ.get() to get variable from command line something like JENKINS_HOST="xx" JENKINS_AUTH="xx" JENKINS_TOKEN="xx" python script.py</p>
  
  <p>In script.py has a function it likes this:</p>
  
  <pre><code>def init_auth():
      login_mode = True
      JENKINS_HOST = os.environ.get("JENKINS_HOST")
      JENKINS_AUTH = os.environ.get("JENKINS_AUTH")
      JENKINS_TOKEN = os.environ.get("JENKINS_TOKEN")
  </code></pre>
  
  <p>when I use pytest to test the function init_auth(), how could I transfer the cli environment to this function?</p>