test_init.py 767 B

1234567891011121314151617181920212223242526
  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_setup(repo_root)
  20. os.environ['PYTHONPATH'] = repo_root
  21. if 'TMUX' in os.environ:
  22. del os.environ['TMUX']