__init__.py 1.3 KB

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