From c7b1c99b06a453af879f4768e347ac89000cce42 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 19 Oct 2013 21:35:33 -0400 Subject: Get rid of our backward implementation of set, sorted, reversed, and rpartition. --HG-- branch : 4.0 --- tests/test_testing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/test_testing.py') diff --git a/tests/test_testing.py b/tests/test_testing.py index c56d8110..c6d51ba5 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`.""" @@ -188,7 +187,7 @@ class CoverageTestTest(CoverageTest): 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 = environ.rpartition(":") self.assertEqual(environ.strip(), "COV_FOOBAR = XYZZY") -- cgit v1.2.1 From bad63e02b113626a048ea5eb253293c61902e291 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 19 Oct 2013 22:08:37 -0400 Subject: Generator expressons are ok now. --HG-- branch : 4.0 --- tests/test_testing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_testing.py') diff --git a/tests/test_testing.py b/tests/test_testing.py index c6d51ba5..64dca617 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -183,10 +183,10 @@ 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 = next(l for l in out if "COV_FOOBAR" in l) _, _, environ = environ.rpartition(":") self.assertEqual(environ.strip(), "COV_FOOBAR = XYZZY") -- cgit v1.2.1