summaryrefslogtreecommitdiff
path: root/t/utils.py
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-07-29 19:04:55 -0400
committerbd <bdunahu@operationnull.com>2025-07-29 19:04:55 -0400
commita27bc8281a9795397fa5c01445140ba6504960f7 (patch)
treeebedc463cb4534412bb8395825d45ff26213779d /t/utils.py
parente27aedcea3f1daf252d99b5fee218250ae1b6d1e (diff)
Add some manual tests for aiohttp and aiofiles
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()