summaryrefslogtreecommitdiff
path: root/t/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 't/utils.py')
-rw-r--r--t/utils.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/utils.py b/t/utils.py
index ee9478d..fd2a4d3 100644
--- a/t/utils.py
+++ b/t/utils.py
@@ -7,7 +7,7 @@ import unittest
class AergiaUnitTestCase(unittest.TestCase):
interval = 0.01
- Aergia = Aergia(interval)
+ Aergia = Aergia(interval, True)
# yappi is a singleton
def setUp(self):
@@ -65,6 +65,18 @@ class AergiaUnitTestCase(unittest.TestCase):
if s.name == func_name:
return s.ttot
+ def yappi_print_traceable_results(self, stats):
+ '''Filters the list of yappi stats, printing information for only the same
+ functions as Aergia. This is for manual testing.'''
+ print(f"{'FILE':<30} {'FUNC':<30} {'SEC':<10}")
+ for s in stats:
+ fname = s.module
+ if Aergia._should_trace(fname):
+ fname = \
+ (fname if len(fname) <= 25 else fname[-25:])
+ print(f"{fname}:{s.lineno}".ljust(30) +
+ f"{s.name:<30} {s.ttot:<10.4f}")
+
def burn_cpu(sec):
t0 = Aergia._gettime()