Skip to content

Commit

Permalink
Fix missing annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Jan 5, 2016
1 parent 6945b06 commit 495291a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/pytest_benchmark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ def prepare_benchmarks(self):
yield flat_bench
flat_bench = bench.as_dict(include_data=False, flat=True)
flat_bench["path"] = None
if compared:
annotate_source(flat_bench, "NOW")
annotate_source(flat_bench, compared and "NOW")
yield flat_bench

@property
Expand Down
9 changes: 6 additions & 3 deletions src/pytest_benchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,11 @@ def annotate_source(bench, source):
bench.update(
canonical_name=bench["name"],
canonical_fullname=bench["fullname"],
name="{0} ({1})".format(bench["name"], source),
fullname="{0} ({1})".format(bench["fullname"], source),
)
bench["source"] = source
if source:
bench.update(
name="{0} ({1})".format(bench["name"], source),
fullname="{0} ({1})".format(bench["fullname"], source),
)
bench["source"] = source
return bench

0 comments on commit 495291a

Please sign in to comment.