summaryrefslogtreecommitdiff
path: root/tests/test_api.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_api.py
parenta035bde3320a501720ae722dc6b54fe7ff5c8647 (diff)
downloadpython-coveragepy-git-nedbat/unittest2pytest.tar.gz
style: fix long lines and avoid backslashesnedbat/unittest2pytest
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 7d75022e..bce431f3 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -548,8 +548,7 @@ class ApiTest(CoverageTest):
assert "Hello\n" in out
err = self.stderr()
- assert "Coverage.py warning: Module sys has no Python source. (module-not-python)" in \
- err
+ assert "Coverage.py warning: Module sys has no Python source. (module-not-python)" in err
assert "module-not-imported" not in err
assert "no-data-collected" not in err
@@ -634,8 +633,7 @@ class ApiTest(CoverageTest):
# Labeled data is collected
data = cov.get_data()
- assert [u'', u'multiply_six', u'multiply_zero'] == \
- sorted(data.measured_contexts())
+ assert [u'', u'multiply_six', u'multiply_zero'] == sorted(data.measured_contexts())
filenames = self.get_measured_filenames(data)
suite_filename = filenames['testsuite.py']
@@ -673,8 +671,8 @@ class ApiTest(CoverageTest):
# Labeled data is collected
data = cov.get_data()
- assert [u'mysuite', u'mysuite|multiply_six', u'mysuite|multiply_zero'] == \
- sorted(data.measured_contexts())
+ expected = [u'mysuite', u'mysuite|multiply_six', u'mysuite|multiply_zero']
+ assert expected == sorted(data.measured_contexts())
filenames = self.get_measured_filenames(data)
suite_filename = filenames['testsuite.py']
@@ -691,8 +689,8 @@ class ApiTest(CoverageTest):
# Switch twice, but only get one warning.
cov.switch_context("test1") # pragma: nested
cov.switch_context("test2") # pragma: nested
- assert self.stderr() == \
- "Coverage.py warning: Conflicting dynamic contexts (dynamic-conflict)\n"
+ expected = "Coverage.py warning: Conflicting dynamic contexts (dynamic-conflict)\n"
+ assert expected == self.stderr()
cov.stop() # pragma: nested
def test_switch_context_unstarted(self):