• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
4"""Determine facts about the environment."""
5
6import os
7import sys
8
9# Operating systems.
10WINDOWS = sys.platform == "win32"
11LINUX = sys.platform == "linux2"
12
13# Python implementations.
14PYPY = '__pypy__' in sys.builtin_module_names
15
16# Python versions.
17PYVERSION = sys.version_info
18PY2 = PYVERSION < (3, 0)
19PY3 = PYVERSION >= (3, 0)
20
21# Coverage.py specifics.
22
23# Are we using the C-implemented trace function?
24C_TRACER = os.getenv('COVERAGE_TEST_TRACER', 'c') == 'c'
25
26# Are we coverage-measuring ourselves?
27METACOV = os.getenv('COVERAGE_COVERAGE', '') != ''
28
29# Are we running our test suite?
30# Even when running tests, you can use COVERAGE_TESTING=0 to disable the
31# test-specific behavior like contracts.
32TESTING = os.getenv('COVERAGE_TESTING', '') == 'True'
33