__init__.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
  2. # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
  3. """Code coverage measurement for Python.
  4. Ned Batchelder
  5. http://nedbatchelder.com/code/coverage
  6. """
  7. from coverage.version import __version__, __url__, version_info
  8. from coverage.control import Coverage, process_startup
  9. from coverage.data import CoverageData
  10. from coverage.misc import CoverageException
  11. from coverage.plugin import CoveragePlugin, FileTracer, FileReporter
  12. from coverage.pytracer import PyTracer
  13. # Backward compatibility.
  14. coverage = Coverage
  15. # On Windows, we encode and decode deep enough that something goes wrong and
  16. # the encodings.utf_8 module is loaded and then unloaded, I don't know why.
  17. # Adding a reference here prevents it from being unloaded. Yuk.
  18. import encodings.utf_8
  19. # Because of the "from coverage.control import fooey" lines at the top of the
  20. # file, there's an entry for coverage.coverage in sys.modules, mapped to None.
  21. # This makes some inspection tools (like pydoc) unable to find the class
  22. # coverage.coverage. So remove that entry.
  23. import sys
  24. try:
  25. del sys.modules['coverage.coverage']
  26. except KeyError:
  27. pass