diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-19 22:08:37 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-19 22:08:37 -0400 |
commit | bad63e02b113626a048ea5eb253293c61902e291 (patch) | |
tree | efb98eaafdf9d9212b53a1e51a782f7ff00cca41 /tests | |
parent | b3df60a544a54b4dd604d34137ff08e02b815e81 (diff) | |
download | python-coveragepy-git-bad63e02b113626a048ea5eb253293c61902e291.tar.gz |
Generator expressons are ok now.
--HG--
branch : 4.0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/coveragetest.py | 10 | ||||
-rw-r--r-- | tests/test_farm.py | 4 | ||||
-rw-r--r-- | tests/test_phystokens.py | 2 | ||||
-rw-r--r-- | tests/test_process.py | 2 | ||||
-rw-r--r-- | tests/test_testing.py | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py index cb2957da..d4d82f12 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -266,10 +266,10 @@ class CoverageTest(TestCase): # Map chars to numbers for arcz_to_arcs _arcz_map = {'.': -1} - _arcz_map.update(dict([(c, ord(c)-ord('0')) for c in '123456789'])) + _arcz_map.update(dict((c, ord(c)-ord('0')) for c in '123456789')) _arcz_map.update(dict( - [(c, 10+ord(c)-ord('A')) for c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'] - )) + (c, 10+ord(c)-ord('A')) for c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + )) def arcz_to_arcs(self, arcz): """Convert a compact textual representation of arcs to a list of pairs. @@ -305,8 +305,8 @@ class CoverageTest(TestCase): def assertEqualArcs(self, a1, a2, msg=None): """Assert that the arc lists `a1` and `a2` are equal.""" # Make them into multi-line strings so we can see what's going wrong. - s1 = "\n".join([repr(a) for a in a1]) + "\n" - s2 = "\n".join([repr(a) for a in a2]) + "\n" + s1 = "\n".join(repr(a) for a in a1) + "\n" + s2 = "\n".join(repr(a) for a in a2) + "\n" self.assertMultiLineEqual(s1, s2, msg) def check_coverage(self, text, lines=None, missing="", report="", diff --git a/tests/test_farm.py b/tests/test_farm.py index fee28063..c86983e5 100644 --- a/tests/test_farm.py +++ b/tests/test_farm.py @@ -78,10 +78,10 @@ class FarmTestCase(object): copy run runfunc compare contains doesnt_contain clean skip """.split() if self.clean_only: - glo = dict([(fn, self.noop) for fn in fns]) + glo = dict((fn, self.noop) for fn in fns) glo['clean'] = self.clean else: - glo = dict([(fn, getattr(self, fn)) for fn in fns]) + glo = dict((fn, getattr(self, fn)) for fn in fns) if self.dont_clean: # pragma: not covered glo['clean'] = self.noop diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index 76e59f3b..9ff053c4 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -29,7 +29,7 @@ class PhysTokensTest(CoverageTest): """Tokenize `source`, then put it back together, should be the same.""" tokenized = "" for line in source_token_lines(source): - text = "".join([t for _,t in line]) + text = "".join(t for _, t in line) tokenized += text + "\n" # source_token_lines doesn't preserve trailing spaces, so trim all that # before comparing. diff --git a/tests/test_process.py b/tests/test_process.py index d1107e32..4453fc57 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -270,7 +270,7 @@ class ProcessTest(CoverageTest): if '__pypy__' in sys.builtin_module_names: # Pypy has an extra frame in the traceback for some reason lines2 = out2.splitlines() - out2 = "".join([l+"\n" for l in lines2 if "toplevel" not in l]) + out2 = "".join(l+"\n" for l in lines2 if "toplevel" not in l) self.assertMultiLineEqual(out, out2) # But also make sure that the output is what we expect. 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") |