summaryrefslogtreecommitdiff
path: root/tests/test_debug.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-02-06 18:35:50 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-02-06 18:57:25 -0500
commitb60b789717d035cf6247428916a3a1a4de526781 (patch)
tree8b3782038337cd3d3598e6bf240616ca8fc13013 /tests/test_debug.py
parent4864c4f01a145f32113b8794499fd7706d857400 (diff)
downloadpython-coveragepy-git-b60b789717d035cf6247428916a3a1a4de526781.tar.gz
test: nicer way to test debug=pybehave
Diffstat (limited to 'tests/test_debug.py')
-rw-r--r--tests/test_debug.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_debug.py b/tests/test_debug.py
index bade588e..b4ce6d92 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -3,6 +3,7 @@
"""Tests of coverage/debug.py"""
+import ast
import io
import os
import re
@@ -202,8 +203,8 @@ class DebugTraceTest(CoverageTest):
out_text = self.f1_debug_output(["pybehave"])
out_lines = out_text.splitlines()
assert 10 < len(out_lines) < 40
- pyversion = next(l for l in out_lines if " PYVERSION:" in l)
- vtuple = eval(pyversion.partition(":")[-1]) # pylint: disable=eval-used
+ pyversion = re_line(r" PYVERSION:", out_text)
+ vtuple = ast.literal_eval(pyversion.partition(":")[-1].strip())
assert vtuple[:5] == sys.version_info