summaryrefslogtreecommitdiff
path: root/tests/test_data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-01-31 10:10:47 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-01-31 10:10:47 -0500
commitd02be78c3a0ee3022be56c623bb9bdcad1e9acd4 (patch)
tree1e74153bb4741f6a9e2f1e1f55d2b9960a490bb3 /tests/test_data.py
parenta035bde3320a501720ae722dc6b54fe7ff5c8647 (diff)
downloadpython-coveragepy-git-nedbat/unittest2pytest.tar.gz
style: fix long lines and avoid backslashesnedbat/unittest2pytest
Diffstat (limited to 'tests/test_data.py')
-rw-r--r--tests/test_data.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/test_data.py b/tests/test_data.py
index 4eda1873..789bdd5a 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -209,8 +209,7 @@ class CoverageDataTest(DataTestHelpers, CoverageTest):
covdata = CoverageData()
covdata.set_context('test_a')
covdata.add_lines(LINES_1)
- assert covdata.contexts_by_lineno('a.py') == \
- {1: ['test_a'], 2: ['test_a']}
+ assert covdata.contexts_by_lineno('a.py') == {1: ['test_a'], 2: ['test_a']}
def test_no_duplicate_lines(self):
covdata = CoverageData()
@@ -251,8 +250,8 @@ class CoverageDataTest(DataTestHelpers, CoverageTest):
covdata = CoverageData()
covdata.set_context('test_x')
covdata.add_arcs(ARCS_3)
- assert covdata.contexts_by_lineno('x.py') == \
- {-1: ['test_x'], 1: ['test_x'], 2: ['test_x'], 3: ['test_x']}
+ expected = {-1: ['test_x'], 1: ['test_x'], 2: ['test_x'], 3: ['test_x']}
+ assert expected == covdata.contexts_by_lineno('x.py')
def test_contexts_by_lineno_with_unknown_file(self):
covdata = CoverageData()
@@ -587,9 +586,12 @@ class CoverageDataFilesTest(DataTestHelpers, CoverageTest):
covdata2.read()
self.assert_line_counts(covdata2, SUMMARY_1)
- assert re.search(r"^Erasing data file '.*\.coverage'\n" \
- r"Creating data file '.*\.coverage'\n" \
- r"Opening data file '.*\.coverage'\n$", debug.get_output())
+ assert re.search(
+ r"^Erasing data file '.*\.coverage'\n"
+ r"Creating data file '.*\.coverage'\n"
+ r"Opening data file '.*\.coverage'\n$",
+ debug.get_output()
+ )
def test_debug_output_without_debug_option(self):
# With a debug object, but not the dataio option, we don't get debug