summaryrefslogtreecommitdiff
path: root/tests/test_testing.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-12-13 22:45:10 -0500
committerNed Batchelder <ned@nedbatchelder.com>2013-12-13 22:45:10 -0500
commit2df9b1c35cbb5c92204fc5923368a3d619a34f6d (patch)
treed1ede8ffef812ba4e345b08f698f001ebe69cb56 /tests/test_testing.py
parent84221611890880b749dbb650e8d07ac8918dba46 (diff)
parent7c66441eab3af17539c478a2cb4e19cd93ba0cf4 (diff)
downloadpython-coveragepy-git-2df9b1c35cbb5c92204fc5923368a3d619a34f6d.tar.gz
Merged 4.0 to default
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r--tests/test_testing.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py
index c56d8110..64dca617 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -2,11 +2,10 @@
"""Tests that our test infrastructure is really working!"""
import os, sys
-from coverage.backward import to_bytes, rpartition
+from coverage.backward import to_bytes
from tests.backunittest import TestCase
from tests.coveragetest import CoverageTest
-from coverage.backward import set # pylint: disable=W0622
class TestingTest(TestCase):
"""Tests of helper methods on `backunittest.TestCase`."""
@@ -184,11 +183,11 @@ class CoverageTestTest(CoverageTest):
# Try it with a "coverage debug sys" command.
out = self.run_command("coverage debug sys").splitlines()
# "environment: COV_FOOBAR = XYZZY" or "COV_FOOBAR = XYZZY"
- executable = [l for l in out if "executable:" in l][0]
+ executable = next(l for l in out if "executable:" in l)
executable = executable.split(":", 1)[1].strip()
self.assertTrue(same_python_executable(executable, sys.executable))
- environ = [l for l in out if "COV_FOOBAR" in l][0]
- _, _, environ = rpartition(environ, ":")
+ environ = next(l for l in out if "COV_FOOBAR" in l)
+ _, _, environ = environ.rpartition(":")
self.assertEqual(environ.strip(), "COV_FOOBAR = XYZZY")