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 | b90e592e26da67372cb633150c49372799dc51bf (patch) | |
tree | d822e639649bd73b4c41d1d82a64bf457c477535 /tests/test_concurrency.py | |
parent | 9298cc26cae698bd7e7ab0c0e0a8d0931d77f7e2 (diff) | |
download | python-coveragepy-b90e592e26da67372cb633150c49372799dc51bf.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 02163d2..77b8c0e 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: |