test_init.py 866 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python3
  2. #
  3. # mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet
  4. # Copyright (C)2013-2023 The MMGen Project <mmgen@tuta.io>
  5. # Licensed under the GNU General Public License, Version 3:
  6. # https://www.gnu.org/licenses
  7. # Public project repositories:
  8. # https://github.com/mmgen/mmgen
  9. # https://gitlab.com/mmgen/mmgen
  10. """
  11. test.include.test_init: Initialization module for test scripts
  12. """
  13. import sys,os
  14. os.environ['MMGEN_TEST_SUITE'] = '1'
  15. repo_root = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),os.pardir)))
  16. os.chdir(repo_root)
  17. sys.path[0] = repo_root
  18. from test.overlay import overlay_setup
  19. overlay_root = overlay_setup(repo_root)
  20. os.environ['PYTHONPATH'] = overlay_root
  21. if 'TMUX' in os.environ:
  22. del os.environ['TMUX']
  23. if os.getenv('MMGEN_DEVTOOLS'):
  24. from mmgen.devinit import init_dev
  25. init_dev()