summaryrefslogtreecommitdiff
path: root/tests/test_oddball.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_oddball.py
parenta035bde3320a501720ae722dc6b54fe7ff5c8647 (diff)
downloadpython-coveragepy-git-nedbat/unittest2pytest.tar.gz
style: fix long lines and avoid backslashesnedbat/unittest2pytest
Diffstat (limited to 'tests/test_oddball.py')
-rw-r--r--tests/test_oddball.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/tests/test_oddball.py b/tests/test_oddball.py
index 46c22f9c..afbf232a 100644
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -130,8 +130,7 @@ class RecursionTest(CoverageTest):
# Get a warning about the stackoverflow effect on the tracing function.
if pytrace: # pragma: no metacov
- assert cov._warnings == \
- ["Trace function changed, measurement is likely wrong: None"]
+ assert cov._warnings == ["Trace function changed, measurement is likely wrong: None"]
else:
assert cov._warnings == []
@@ -277,8 +276,8 @@ class PyexpatTest(CoverageTest):
# Make sure pyexpat isn't recorded as a source file.
# https://github.com/nedbat/coveragepy/issues/419
files = cov.get_data().measured_files()
- assert not any(f.endswith("pyexpat.c") for f in files), \
- "Pyexpat.c is in the measured files!: %r:" % (files,)
+ msg = "Pyexpat.c is in the measured files!: %r:" % (files,)
+ assert not any(f.endswith("pyexpat.c") for f in files), msg
class ExceptionTest(CoverageTest):
@@ -485,14 +484,13 @@ class GettraceTest(CoverageTest):
)
out = self.stdout().replace(self.last_module_name, "coverage_test")
-
- assert out == \
- (
- "call: coverage_test.py @ 10\n"
- "line: coverage_test.py @ 11\n"
- "line: coverage_test.py @ 12\n"
- "return: coverage_test.py @ 12\n"
- )
+ expected = (
+ "call: coverage_test.py @ 10\n"
+ "line: coverage_test.py @ 11\n"
+ "line: coverage_test.py @ 12\n"
+ "return: coverage_test.py @ 12\n"
+ )
+ assert expected == out
@pytest.mark.expensive
def test_atexit_gettrace(self): # pragma: no metacov