From b60b789717d035cf6247428916a3a1a4de526781 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 6 Feb 2022 18:35:50 -0500 Subject: test: nicer way to test debug=pybehave --- tests/test_debug.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/test_debug.py') 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 -- cgit v1.2.1