__init__.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- coding: utf-8 -*-
  2. """!@package grass.gunittest
  3. @brief GRASS Python testing framework module for running from command line
  4. Copyright (C) 2014 by the GRASS Development Team
  5. This program is free software under the GNU General Public
  6. License (>=v2). Read the file COPYING that comes with GRASS GIS
  7. for details.
  8. @author Vaclav Petras
  9. @author Soeren Gebbert
  10. Initial version of `gunittest` was created during Google Summer of Code 2014
  11. by Vaclav Petras as a student and Soeren Gebbert as a mentor.
  12. """
  13. from __future__ import print_function
  14. try:
  15. from .case import TestCase
  16. from .main import test
  17. except ImportError, e:
  18. print('WARNING: Cannot import ({e.message}).\n'
  19. 'Ignoring the failed import because it does not harm if you need'
  20. ' something different'
  21. ' from gunittest. Probably the environment is not set properly'
  22. ' (e.g. dynamic libraries are not available and ctypes-based modules'
  23. ' cannot work).'.format(e=e))
  24. # we need to ignore import errors for the cases when we just need
  25. # gunittest for reports and ctypes are not available (or the environment
  26. # is not set properly)
  27. # .main probably does not need to be checked but it imports a lot of
  28. # things, so it might be hard to keep track in the future
  29. # .case imports PyGRASS which imports ctypes modules in its __init__.py