diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2020-12-20 20:19:49 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-01-03 06:26:21 -0500 |
commit | 7ff93a9740da5dec4eba6c6cad288d25a472d75a (patch) | |
tree | b81243f1508e4727dc28094c48be84ac6ae07706 /coverage/sqldata.py | |
parent | 12c5fcd57fd1cce3bc3563732f5502f5e943c0e0 (diff) | |
download | python-coveragepy-git-7ff93a9740da5dec4eba6c6cad288d25a472d75a.tar.gz |
Use set literals
Diffstat (limited to 'coverage/sqldata.py')
-rw-r--r-- | coverage/sqldata.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coverage/sqldata.py b/coverage/sqldata.py index 7a3b5c79..b28b83b4 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -784,7 +784,7 @@ class CoverageData(SimpleReprMixin): """ self._start_using() with self._connect() as con: - contexts = set(row[0] for row in con.execute("select distinct(context) from context")) + contexts = {row[0] for row in con.execute("select distinct(context) from context")} return contexts def file_tracer(self, filename): @@ -857,7 +857,7 @@ class CoverageData(SimpleReprMixin): arcs = self.arcs(filename) if arcs is not None: all_lines = itertools.chain.from_iterable(arcs) - return list(set(l for l in all_lines if l > 0)) + return list({l for l in all_lines if l > 0}) with self._connect() as con: file_id = self._file_id(filename) |