diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-18 13:25:49 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-18 13:25:49 -0500 |
commit | 8d60d392c5d9b00560c4a9418902f12126dae125 (patch) | |
tree | c6634c5c0b940a32c1fb0afb36b4a928a91f3304 /tests/test_concurrency.py | |
parent | 0d0836309b6354a07fb09cd8d28b309b6c8dba6c (diff) | |
download | python-coveragepy-git-8d60d392c5d9b00560c4a9418902f12126dae125.tar.gz |
Collect all the nudgy environment checks into coverage.env
Diffstat (limited to 'tests/test_concurrency.py')
-rw-r--r-- | tests/test_concurrency.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 02163d2f..77b8c0ec 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -1,8 +1,11 @@ """Tests for concurrency libraries.""" -import os, os.path, sys, threading +import os +import os.path +import threading import coverage +from coverage import env from tests.coveragetest import CoverageTest @@ -24,9 +27,6 @@ try: except ImportError: greenlet = None -# Are we running with the C tracer or not? -C_TRACER = os.getenv('COVERAGE_TEST_TRACER', 'c') == 'c' - def line_count(s): """How many non-blank non-comment lines are in `s`?""" @@ -78,7 +78,7 @@ class ConcurrencyTest(CoverageTest): """.format(LIMIT=LIMIT) # Import the things to use threads. - if sys.version_info < (3, 0): + if env.PY2: THREAD = """\ import threading import Queue as queue @@ -135,7 +135,7 @@ class ConcurrencyTest(CoverageTest): "the module isn't installed.\n" % concurrency ) self.assertEqual(out, expected_out) - elif C_TRACER or concurrency == "thread": + elif env.C_TRACER or concurrency == "thread": # We can fully measure the code if we are using the C tracer, which # can support all the concurrency, or if we are using threads. if expected_out is None: |