File: test_coverup_45.py

package info (click to toggle)
scalene 1.5.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,528 kB
  • sloc: cpp: 22,930; python: 13,403; javascript: 11,769; ansic: 817; makefile: 196; sh: 45
file content (17 lines) | stat: -rw-r--r-- 582 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# file scalene/scalene_utility.py:112-121
# lines [112, 114, 115, 116, 117, 118, 119, 120, 121]
# branches ['115->116', '115->121', '116->117', '116->119']

import pytest
from scalene.scalene_utility import flamegraph_format

def test_flamegraph_format():
    stacks = {
        (('file1.py', 'function1', 10), ('file2.py', 'function2', 20)): [1],
        (('file3.py', 'function3', 30),): [2]
    }
    expected_output = (
        "file1.py function1:10;file2.py function2:20; 1\n"
        "file3.py function3:30; 2\n"
    )
    assert flamegraph_format(stacks) == expected_output