Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgerdesnv authored and dzier committed Jul 27, 2020
1 parent 8b91cb0 commit e7301d7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions qa/L0_function_stack/test_pyprof_func_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ def tearDown(self):
pass

def compare_funcstack(self, actual_tracemarker, expected_str):
# Given a funcstack string, remove TestPyProfFuncStack::run and everything above it
# Given a funcstack string, remove TestPyProfFuncStack::__call__/run and everything above it
#
def remove_test_class_hierarchy(x):
separator = "/"
fn_split = x.split(separator)
split = 0
# Find the LAST instance of run in the split
#
for i, n in enumerate(fn_split):
if (n == "run"):
fn_split = fn_split[i+1:]
break
split = i+1

fn_split = fn_split[split:]
joined = separator.join(fn_split)
return joined

Expand Down Expand Up @@ -103,7 +106,7 @@ def test_ignore_class_call(self):

def wrapper_func():
tracemarker = pyprof.nvtx.nvmarker.traceMarker("opname")
self.compare_funcstack(tracemarker,"test_ignore_class_call/func1/func2/func3/opname")
self.compare_funcstack(tracemarker,"test_ignore_class_call/func1/func2/ExecutableClass::__call__/func3/opname")

def func3():
wrapper_func()
Expand Down

0 comments on commit e7301d7

Please sign in to comment.