Skip to content

Instantly share code, notes, and snippets.

@tkmru
Created September 12, 2017 04:52
Show Gist options
  • Save tkmru/c3aee5f2cba54f3ceac22c26bd4e2dc9 to your computer and use it in GitHub Desktop.
Save tkmru/c3aee5f2cba54f3ceac22c26bd4e2dc9 to your computer and use it in GitHub Desktop.
change env variable for using EnvironmentVarGuard
import unittest
from test.support import EnvironmentVarGuard
class TestConnection(unittest.TestCase):
pass
if __name__ == "__main__":
env = EnvironmentVarGuard()
env.set('DEVELOP_USER', 'test_user')
env.set('DEVELOP_PASSWORD', 'test_password')
with env:
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment