tools.py 749 B

12345678910111213141516171819202122232425262728
  1. # -*- coding: utf-8 -*-
  2. # test/tools.py
  3. # Part of enum, a package providing enumerated types for Python.
  4. #
  5. # Copyright © 2007–2009 Ben Finney <ben+python@benfinney.id.au>
  6. # This is free software; you may copy, modify and/or distribute this work
  7. # under the terms of the GNU General Public License, version 2 or later
  8. # or, at your option, the terms of the Python license.
  9. """ Helper tools for unit tests.
  10. """
  11. import os.path
  12. import sys
  13. test_dir = os.path.dirname(os.path.abspath(__file__))
  14. code_dir = os.path.dirname(test_dir)
  15. if not test_dir in sys.path:
  16. sys.path.insert(1, test_dir)
  17. if not code_dir in sys.path:
  18. sys.path.insert(1, code_dir)
  19. # Local variables:
  20. # mode: python
  21. # End:
  22. # vim: filetype=python fileencoding=utf-8 :