summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/ctracer/tracer.c1
-rw-r--r--coverage/pytracer.py4
-rw-r--r--lab/benchmark.py51
3 files changed, 26 insertions, 30 deletions
diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c
index 442ea514..570e8d8d 100644
--- a/coverage/ctracer/tracer.c
+++ b/coverage/ctracer/tracer.c
@@ -514,6 +514,7 @@ CTracer_handle_call(CTracer *self, PyFrameObject *frame)
Py_XDECREF(self->pcur_entry->file_data);
self->pcur_entry->file_data = NULL;
self->pcur_entry->file_tracer = Py_None;
+ frame->f_trace_lines = 0;
SHOWLOG(PyFrame_GetLineNumber(frame), filename, "skipped");
}
diff --git a/coverage/pytracer.py b/coverage/pytracer.py
index 1f0f7924..08050b58 100644
--- a/coverage/pytracer.py
+++ b/coverage/pytracer.py
@@ -161,6 +161,7 @@ class PyTracer:
self.cur_file_data = self.data[tracename]
else:
frame.f_trace_lines = False
+
# The call event is really a "start frame" event, and happens for
# function calls and re-entering generators. The f_lasti field is
# -1 for calls, and a real offset for generators. Use <0 as the
@@ -176,6 +177,7 @@ class PyTracer:
self.last_line = -frame.f_code.co_firstlineno
else:
self.last_line = frame.f_lineno
+
elif event == 'line':
# Record an executed line.
if self.cur_file_data is not None:
@@ -186,6 +188,7 @@ class PyTracer:
else:
self.cur_file_data.add(lineno)
self.last_line = lineno
+
elif event == 'return':
if self.trace_arcs and self.cur_file_data:
# Record an arc leaving the function, but beware that a
@@ -213,6 +216,7 @@ class PyTracer:
if real_return:
first = frame.f_code.co_firstlineno
self.cur_file_data.add((self.last_line, -first))
+
# Leaving this function, pop the filename stack.
self.cur_file_data, self.cur_file_name, self.last_line, self.started_context = (
self.data_stack.pop()
diff --git a/lab/benchmark.py b/lab/benchmark.py
index 27d05423..608cfd51 100644
--- a/lab/benchmark.py
+++ b/lab/benchmark.py
@@ -257,44 +257,35 @@ with change_dir(PERF_DIR):
run_experiments(
py_versions=[
+ Python(3, 7),
Python(3, 10),
],
cov_versions=[
("none", None, None),
("6.4", "coverage==6.4", ""),
- ("6.4 timid", "coverage==6.4", "timid=True"),
- (
- "PR 1381",
- "git+https://github.com/cfbolz/coveragepy.git@f_trace_lines",
- "",
- ),
- (
- "PR 1381 timid",
- "git+https://github.com/cfbolz/coveragepy.git@f_trace_lines",
- "timid=True",
- ),
+ ("tip", "-e ~/coverage/trunk", ""),
],
projects=[
PytestHtml(),
],
- num_runs=3,
+ num_runs=5,
)
- run_experiments(
- py_versions=[
- PyPy(3, 9),
- ],
- cov_versions=[
- ("none", None, None),
- ("6.4", "coverage==6.4", ""),
- (
- "PR 1381",
- "git+https://github.com/cfbolz/coveragepy.git@f_trace_lines",
- "",
- ),
- ],
- projects=[
- PytestHtml(),
- ],
- num_runs=3,
- )
+ # run_experiments(
+ # py_versions=[
+ # PyPy(3, 9),
+ # ],
+ # cov_versions=[
+ # ("none", None, None),
+ # ("6.4", "coverage==6.4", ""),
+ # (
+ # "PR 1381",
+ # "git+https://github.com/cfbolz/coveragepy.git@f_trace_lines",
+ # "",
+ # ),
+ # ],
+ # projects=[
+ # PytestHtml(),
+ # ],
+ # num_runs=3,
+ # )