Skip to content

Format and White-spacing #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 18, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
print function
  • Loading branch information
vmuriart committed Apr 18, 2016
commit 1b0810869bd18ed9e749600e45dd02299e29525e
9 changes: 5 additions & 4 deletions src/tests/leaktest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import System
import gc

Expand All @@ -15,7 +16,7 @@ def __init__(self):

def notify(self, msg):
if not self.quiet:
print msg
print(msg)

def start_test(self):
System.GC.Collect(System.GC.MaxGeneration)
Expand All @@ -32,8 +33,8 @@ def end_test(self):
diff = '+%d' % diff
else:
diff = '%d' % diff
print " start: %d end: %d diff: %s" % (start, end, diff)
print ""
print(" start: %d end: %d diff: %s" % (start, end, diff))
print("")

def run(self):
self.testModules()
Expand All @@ -48,7 +49,7 @@ def report(self):
dicttype = type({})
for item in gc.get_objects():
if type(item) != dicttype:
print item, sys.getrefcount(item)
print(item, sys.getrefcount(item))

def testModules(self):
self.notify("Running module leak check...")
Expand Down
7 changes: 4 additions & 3 deletions src/tests/profile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Run all of the unit tests for this package over and over,
in order to provide for better profiling."""
from __future__ import print_function


def main():
Expand All @@ -14,15 +15,15 @@ def main():
start = time.clock()

for i in range(50):
print 'iteration: %d' % i
print('iteration: %d' % i)
runtests.main()

stop = time.clock()
took = str(stop - start)
print 'Total Time: %s' % took
print('Total Time: %s' % took)

for item in gc.get_objects():
print item, sys.getrefcount(item)
print(item, sys.getrefcount(item))


if __name__ == '__main__':
Expand Down
5 changes: 3 additions & 2 deletions src/tests/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
for memory leaks and threading issues and provides a good target for a
profiler to accumulate better data.
"""
from __future__ import print_function

import sys, os, gc, time, threading, thread

Expand All @@ -19,7 +20,7 @@ def __init__(self):

def dprint(self, msg):
# Debugging helper to trace thread-related tests.
if 1: print msg
if 1: print(msg)

def markStart(self):
self._start = time.clock()
Expand All @@ -32,7 +33,7 @@ def elapsed(self):

def printGCReport(self):
for item in gc.get_objects():
print item, sys.getrefcount(item)
print(item, sys.getrefcount(item))

def runThread(self, iterations):
thread_id = thread.get_ident()
Expand Down
4 changes: 2 additions & 2 deletions src/tests/stresstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def main():
start = time.clock()

for i in range(2000):
print i
print(i)
for name in (
'test_module',
'test_conversion',
Expand All @@ -32,7 +32,7 @@ def main():

import gc
for i in gc.get_objects():
print i
print(i)


if __name__ == '__main__':
Expand Down