__init__.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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. # TODO: consider removing all from here before the backport or release
  12. from __future__ import print_function
  13. try:
  14. from .case import TestCase
  15. from .main import test
  16. except ImportError, e:
  17. print('WARNING: Cannot import ({e.message}).\n'
  18. 'Ignoring the failed import because it does not harm if you need'
  19. ' something different'
  20. ' from gunittest. Probably the environment is not set properly'
  21. ' (e.g. dynamic libraries are not available and ctypes-based modules'
  22. ' cannot work).'.format(e=e))
  23. # we need to ignore import errors for the cases when we just need
  24. # gunittest for reports and ctypes are not available (or the environment
  25. # is not set properly)
  26. # .main probably does not need to be checked but it imports a lot of
  27. # things, so it might be hard to keep track in the future
  28. # .case imports PyGRASS which imports ctypes modules in its __init__.py