Skip to content

Commit 3d1e0a6

Browse files
committed
Added (optional) memory tracking to integration tests
1 parent 400fde8 commit 3d1e0a6

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

examples/integration_test.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
import struct
3030
from copy import copy
3131

32+
try:
33+
# Memory tracker
34+
from pympler import tracker
35+
with_pympler = True
36+
except Exception as e:
37+
with_pympler = False
38+
39+
3240
try:
3341
from progress.bar import Bar
3442
with_progress = True
@@ -965,7 +973,9 @@ def print_usage(exitcode, reason=None):
965973
sys.exit(exitcode)
966974

967975

968-
if __name__ == '__main__':
976+
def run():
977+
"""Run integration tests"""
978+
969979
modes = list()
970980

971981
# Parse options
@@ -1036,3 +1046,17 @@ def print_usage(exitcode, reason=None):
10361046
verify_admin()
10371047

10381048
print('=' * 30, 'Done', '=' * 30)
1049+
1050+
1051+
if __name__ == '__main__':
1052+
if with_pympler:
1053+
tr = tracker.SummaryTracker()
1054+
print('Running with pympler memory tracker')
1055+
1056+
# Run tests
1057+
run()
1058+
1059+
if with_pympler:
1060+
gc.collect()
1061+
print('Memory tracker results')
1062+
tr.print_diff()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy