Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:illuusio:python3
python-coverage
traced_file_absolute.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File traced_file_absolute.patch of Package python-coverage
From 06cb51b39620e2140f915393f0f41b281594e05b Mon Sep 17 00:00:00 2001 From: Ned Batchelder <ned@nedbatchelder.com> Date: Sat, 8 May 2021 21:27:45 -0400 Subject: [PATCH] test: traced file names seem to be absolute now? #1161 This was changed in 3.10.0b1 and 3.9.5. Seems like a strange change to throw into 3.9.5, but there it is. Fixes #1161. --- tests/test_debug.py | 6 ++++-- tests/test_oddball.py | 16 +++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) --- a/tests/test_debug.py +++ b/tests/test_debug.py @@ -124,8 +124,10 @@ class DebugTraceTest(CoverageTest): def test_debug_trace(self): out_lines = self.f1_debug_output(["trace"]) - # We should have a line like "Tracing 'f1.py'" - assert "Tracing 'f1.py'" in out_lines + # We should have a line like "Tracing 'f1.py'", perhaps with an + # absolute path. + f1 = re_lines(out_lines, r"Tracing '.*f1.py'") + assert f1 # We should have lines like "Not tracing 'collector.py'..." coverage_lines = re_lines( --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -451,10 +451,12 @@ class GettraceTest(CoverageTest): def test_setting_new_trace_function(self): # https://github.com/nedbat/coveragepy/issues/436 self.check_coverage('''\ + import os.path import sys def tracer(frame, event, arg): - print("%s: %s @ %d" % (event, frame.f_code.co_filename, frame.f_lineno)) + filename = os.path.basename(frame.f_code.co_filename) + print("%s: %s @ %d" % (event, filename, frame.f_lineno)) return tracer def begin(): @@ -474,16 +476,16 @@ class GettraceTest(CoverageTest): a = 21 b = 22 ''', - lines=[1, 3, 4, 5, 7, 8, 10, 11, 12, 14, 15, 16, 18, 19, 20, 21, 22], - missing="4-5, 11-12", + lines=[1, 2, 4, 5, 6, 7, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 23, 24], + missing="5-7, 13-14", ) out = self.stdout().replace(self.last_module_name, "coverage_test") 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" + "call: coverage_test.py @ 12\n" + "line: coverage_test.py @ 13\n" + "line: coverage_test.py @ 14\n" + "return: coverage_test.py @ 14\n" ) assert expected == out
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor